{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn.datasets import load_breast_cancer\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.preprocessing import KBinsDiscretizer\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "import graphviz "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Load data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(\"data/titanic_train.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>PC 17599</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C85</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>113803</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>C123</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>373450</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Survived  Pclass  \\\n",
       "0            1         0       3   \n",
       "1            2         1       1   \n",
       "2            3         1       3   \n",
       "3            4         1       1   \n",
       "4            5         0       3   \n",
       "\n",
       "                                                Name     Sex   Age  SibSp  \\\n",
       "0                            Braund, Mr. Owen Harris    male  22.0      1   \n",
       "1  Cumings, Mrs. John Bradley (Florence Briggs Th...  female  38.0      1   \n",
       "2                             Heikkinen, Miss. Laina  female  26.0      0   \n",
       "3       Futrelle, Mrs. Jacques Heath (Lily May Peel)  female  35.0      1   \n",
       "4                           Allen, Mr. William Henry    male  35.0      0   \n",
       "\n",
       "   Parch            Ticket     Fare Cabin Embarked  \n",
       "0      0         A/5 21171   7.2500   NaN        S  \n",
       "1      0          PC 17599  71.2833   C85        C  \n",
       "2      0  STON/O2. 3101282   7.9250   NaN        S  \n",
       "3      0            113803  53.1000  C123        S  \n",
       "4      0            373450   8.0500   NaN        S  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 891 entries, 0 to 890\n",
      "Data columns (total 12 columns):\n",
      " #   Column       Non-Null Count  Dtype  \n",
      "---  ------       --------------  -----  \n",
      " 0   PassengerId  891 non-null    int64  \n",
      " 1   Survived     891 non-null    int64  \n",
      " 2   Pclass       891 non-null    int64  \n",
      " 3   Name         891 non-null    object \n",
      " 4   Sex          891 non-null    object \n",
      " 5   Age          714 non-null    float64\n",
      " 6   SibSp        891 non-null    int64  \n",
      " 7   Parch        891 non-null    int64  \n",
      " 8   Ticket       891 non-null    object \n",
      " 9   Fare         891 non-null    float64\n",
      " 10  Cabin        204 non-null    object \n",
      " 11  Embarked     889 non-null    object \n",
      "dtypes: float64(2), int64(5), object(5)\n",
      "memory usage: 83.7+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def data_preprocess(df):\n",
    "    # Treat None as a category\n",
    "    # df.loc[df['Embarked'].isna(), 'Embarked'] = 'U'\n",
    "    # Feature Preprocessing\n",
    "    del df['PassengerId']\n",
    "    del df['Name']\n",
    "    del df['Ticket']\n",
    "    del df['Cabin']\n",
    "    del df['Age']\n",
    "    #df.dropna(inplace=True)\n",
    "    d_sex={}\n",
    "    d_sex['male'] = 1\n",
    "    d_sex['female'] = 0\n",
    "\n",
    "    #d_embarked = {}\n",
    "    #d_embarked['S'] = 0\n",
    "    #d_embarked['C'] = 1\n",
    "    #d_embarked['Q'] = 2\n",
    "    #d_embarked['U'] = 3\n",
    "\n",
    "    df['Sex'] = df['Sex'].apply(d_sex.get)\n",
    "    df['Sex'] = df['Sex'].astype(int)\n",
    "    #df['Embarked'] = df['Embarked'].apply(d_embarked.get)\n",
    "    #df['Embarked'] = df['Embarked'].astype(int)\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = data_preprocess(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 891 entries, 0 to 890\n",
      "Data columns (total 7 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   Survived  891 non-null    int64  \n",
      " 1   Pclass    891 non-null    int64  \n",
      " 2   Sex       891 non-null    int32  \n",
      " 3   SibSp     891 non-null    int64  \n",
      " 4   Parch     891 non-null    int64  \n",
      " 5   Fare      891 non-null    float64\n",
      " 6   Embarked  889 non-null    object \n",
      "dtypes: float64(1), int32(1), int64(4), object(1)\n",
      "memory usage: 45.4+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Survived  Pclass  Sex  SibSp  Parch     Fare Embarked\n",
       "0         0       3    1      1      0   7.2500        S\n",
       "1         1       1    0      1      0  71.2833        C\n",
       "2         1       3    0      0      0   7.9250        S\n",
       "3         1       1    0      1      0  53.1000        S\n",
       "4         0       3    1      0      0   8.0500        S"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 1, 2], dtype=int64)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([1, 0])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([1, 0, 3, 4, 2, 5, 8], dtype=int64)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 5, 3, 4, 6], dtype=int64)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array(['S', 'C', 'Q', nan], dtype=object)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(df['Pclass'].unique())\n",
    "display(df['Sex'].unique())\n",
    "display(df['SibSp'].unique())\n",
    "display(df['Parch'].unique())\n",
    "#display(df['Fare'].unique())\n",
    "display(df['Embarked'].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def one_hot(df):\n",
    "    df['Pclass_1'] = 0\n",
    "    df['Pclass_2'] = 0\n",
    "    df['Pclass_3'] = 0\n",
    "    df.loc[df['Pclass']==1, 'Pclass_1'] = 1\n",
    "    df.loc[df['Pclass']==2, 'Pclass_2'] = 1\n",
    "    df.loc[df['Pclass']==3, 'Pclass_3'] = 1\n",
    "    # SibSp\n",
    "    for i in range(9):\n",
    "        df[f'SibSp_{i}'] = 0\n",
    "        df.loc[df['SibSp']==i, f'SibSp_{i}'] = 1\n",
    "    # Parch\n",
    "    for i in range(7):\n",
    "        df[f'Parch_{i}'] = 0\n",
    "        df.loc[df['Parch']==i, f'Parch_{i}'] = 1\n",
    "    # Embarked\n",
    "    df[f'Embarked_S'] = 0\n",
    "    df[f'Embarked_C'] = 0\n",
    "    df[f'Embarked_Q'] = 0\n",
    "        \n",
    "    df.loc[df['Embarked']=='S', 'Embarked_S'] = 1\n",
    "    df.loc[df['Embarked']=='C', 'Embarked_C'] = 1\n",
    "    df.loc[df['Embarked']=='Q', 'Embarked_Q'] = 1\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = one_hot(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "      <th>Pclass_1</th>\n",
       "      <th>Pclass_2</th>\n",
       "      <th>Pclass_3</th>\n",
       "      <th>...</th>\n",
       "      <th>Parch_0</th>\n",
       "      <th>Parch_1</th>\n",
       "      <th>Parch_2</th>\n",
       "      <th>Parch_3</th>\n",
       "      <th>Parch_4</th>\n",
       "      <th>Parch_5</th>\n",
       "      <th>Parch_6</th>\n",
       "      <th>Embarked_S</th>\n",
       "      <th>Embarked_C</th>\n",
       "      <th>Embarked_Q</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 29 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Survived  Pclass  Sex  SibSp  Parch     Fare Embarked  Pclass_1  Pclass_2  \\\n",
       "0         0       3    1      1      0   7.2500        S         0         0   \n",
       "1         1       1    0      1      0  71.2833        C         1         0   \n",
       "2         1       3    0      0      0   7.9250        S         0         0   \n",
       "3         1       1    0      1      0  53.1000        S         1         0   \n",
       "4         0       3    1      0      0   8.0500        S         0         0   \n",
       "\n",
       "   Pclass_3  ...  Parch_0  Parch_1  Parch_2  Parch_3  Parch_4  Parch_5  \\\n",
       "0         1  ...        1        0        0        0        0        0   \n",
       "1         0  ...        1        0        0        0        0        0   \n",
       "2         1  ...        1        0        0        0        0        0   \n",
       "3         0  ...        1        0        0        0        0        0   \n",
       "4         1  ...        1        0        0        0        0        0   \n",
       "\n",
       "   Parch_6  Embarked_S  Embarked_C  Embarked_Q  \n",
       "0        0           1           0           0  \n",
       "1        0           0           1           0  \n",
       "2        0           1           0           0  \n",
       "3        0           1           0           0  \n",
       "4        0           1           0           0  \n",
       "\n",
       "[5 rows x 29 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_binaries = df.drop(columns=['Survived', 'Fare', 'Pclass', 'SibSp', 'Parch', 'Embarked'], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Sex</th>\n",
       "      <th>Pclass_1</th>\n",
       "      <th>Pclass_2</th>\n",
       "      <th>Pclass_3</th>\n",
       "      <th>SibSp_0</th>\n",
       "      <th>SibSp_1</th>\n",
       "      <th>SibSp_2</th>\n",
       "      <th>SibSp_3</th>\n",
       "      <th>SibSp_4</th>\n",
       "      <th>SibSp_5</th>\n",
       "      <th>...</th>\n",
       "      <th>Parch_0</th>\n",
       "      <th>Parch_1</th>\n",
       "      <th>Parch_2</th>\n",
       "      <th>Parch_3</th>\n",
       "      <th>Parch_4</th>\n",
       "      <th>Parch_5</th>\n",
       "      <th>Parch_6</th>\n",
       "      <th>Embarked_S</th>\n",
       "      <th>Embarked_C</th>\n",
       "      <th>Embarked_Q</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Sex  Pclass_1  Pclass_2  Pclass_3  SibSp_0  SibSp_1  SibSp_2  SibSp_3  \\\n",
       "0    1         0         0         1        0        1        0        0   \n",
       "1    0         1         0         0        0        1        0        0   \n",
       "2    0         0         0         1        1        0        0        0   \n",
       "3    0         1         0         0        0        1        0        0   \n",
       "4    1         0         0         1        1        0        0        0   \n",
       "\n",
       "   SibSp_4  SibSp_5  ...  Parch_0  Parch_1  Parch_2  Parch_3  Parch_4  \\\n",
       "0        0        0  ...        1        0        0        0        0   \n",
       "1        0        0  ...        1        0        0        0        0   \n",
       "2        0        0  ...        1        0        0        0        0   \n",
       "3        0        0  ...        1        0        0        0        0   \n",
       "4        0        0  ...        1        0        0        0        0   \n",
       "\n",
       "   Parch_5  Parch_6  Embarked_S  Embarked_C  Embarked_Q  \n",
       "0        0        0           1           0           0  \n",
       "1        0        0           0           1           0  \n",
       "2        0        0           1           0           0  \n",
       "3        0        0           1           0           0  \n",
       "4        0        0           1           0           0  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_binaries.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "binary_features = df_binaries.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_binaries = df_binaries.shape[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "binary_values = df_binaries.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create the graph\n",
    "graph = np.zeros((n_binaries, n_binaries))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(n_binaries):\n",
    "    fi = binary_values[:, i]\n",
    "    for j in range(i, n_binaries):\n",
    "        fj = binary_values[:, j]\n",
    "        fij=fi*fj\n",
    "        count = np.sum(fij>0)\n",
    "        graph[i, j] = count\n",
    "        graph[j, i] = count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmQAAAJ0CAYAAAC8xz8nAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzdf7xdVX3n/9ebCEZJFeSXUXComkENYgQUkLECTv2FLY5VRBiL31ECjjMPZ77TabG0mGJ9tN+qZZQROhe1RrQVRH5NnRZoNAgdCwQMhID8qqNSUiR2YBqIcQif7x9nR4/Xc3/kZuecnZzX8/E4j+yzzlprr3Vv7s0nn7X23qkqJEmSNDq7jHoAkiRJ486ATJIkacQMyCRJkkbMgEySJGnEDMgkSZJGzIBMkiRpxJ4y6gHsiD6QtHavkE/Um9rqqrFfe1299U9b62rz5a11BcC8el+LvZ3TYl8Ae7TY14YW+1rQYl/Q7V8fT7TW083ZtbW+XlGXttZXz4ta7Gtxi32Nj8eS1vravf5za331nNByf0e3N9lZWNDiv7Uz2VA11LkNYoZMkiRpxAzIJEmSRqzLaw6SJGlMjVvGaNzmK0mS1DlmyCRJUufMG/UAhswMmSRJ0oiZIZMkSZ0zbhmjnXa+Sc5KsjbJ7UlWJzli1GOSJEkaZKfMkCU5CngzcGhVbUqyN7DbiIclSZJmyT1kO4eFwPqq2gRQVeur6sEkhyW5LsktSa5OsjDJM5PcneQggCR/nuS0kY5ekiSNlZ01ILsGOCDJPUnOT/KaJLsC5wFvq6rDgM8CH6mqR4F/B3wuyUnAnlV14eiGLkm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+zKx0ZKelEshO5Dri4k3RLRGxX9nnWOS7IzMzMhoC6FneWhgsyMzOzxCQdGxEn57f3i4iphce+FhH/1b3WpS3uLI1lut0AMzOzYeiAwu3Ptj32tjJBko4t3N6v7bGvlW8aRMT4HiYXY13kgszMzCw9LeV2T/f7UuviztJwQWZmZpZeLOV2T/f7UsviztLyaS/MzMzS21zS82QF06j8Nvn9FUpm1bW4s4RckJmZmSUWESMSxtW1uLOEfJSlmZlZQ0haBMwjL+5YcvkkAStExLLdalvTuSAzMzMz6zIP6jczMzPrMhdkZmZmZl3mgszMzMysy1yQmZmZmXWZCzIzMzOzLvv/HbMdbZeIwqYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 720x720 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure(figsize=(10, 10))\n",
    "#plt.imshow(graph, cmap=plt.cm.hot_r)\n",
    "sns.heatmap(graph, xticklabels=binary_features, yticklabels=binary_features, cmap=plt.cm.hot_r)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "degrees = graph.sum(axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature</th>\n",
       "      <th>degree</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SibSp_7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>SibSp_6</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Parch_6</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Parch_4</td>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Parch_5</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Parch_3</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>SibSp_5</td>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SibSp_8</td>\n",
       "      <td>32.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>SibSp_3</td>\n",
       "      <td>69.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>SibSp_4</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>SibSp_2</td>\n",
       "      <td>127.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Embarked_Q</td>\n",
       "      <td>349.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Parch_2</td>\n",
       "      <td>351.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Parch_1</td>\n",
       "      <td>530.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Embarked_C</td>\n",
       "      <td>767.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Pclass_2</td>\n",
       "      <td>844.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>SibSp_1</td>\n",
       "      <td>939.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Pclass_1</td>\n",
       "      <td>984.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Pclass_3</td>\n",
       "      <td>2311.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SibSp_0</td>\n",
       "      <td>2864.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Sex</td>\n",
       "      <td>2885.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Embarked_S</td>\n",
       "      <td>3017.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Parch_0</td>\n",
       "      <td>3194.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       feature  degree\n",
       "11     SibSp_7     0.0\n",
       "10     SibSp_6     0.0\n",
       "19     Parch_6     4.0\n",
       "17     Parch_4    18.0\n",
       "18     Parch_5    21.0\n",
       "16     Parch_3    21.0\n",
       "9      SibSp_5    24.0\n",
       "12     SibSp_8    32.0\n",
       "7      SibSp_3    69.0\n",
       "8      SibSp_4    84.0\n",
       "6      SibSp_2   127.0\n",
       "22  Embarked_Q   349.0\n",
       "15     Parch_2   351.0\n",
       "14     Parch_1   530.0\n",
       "21  Embarked_C   767.0\n",
       "2     Pclass_2   844.0\n",
       "5      SibSp_1   939.0\n",
       "1     Pclass_1   984.0\n",
       "3     Pclass_3  2311.0\n",
       "4      SibSp_0  2864.0\n",
       "0          Sex  2885.0\n",
       "20  Embarked_S  3017.0\n",
       "13     Parch_0  3194.0"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_degrees = pd.DataFrame()\n",
    "df_degrees['feature'] = binary_features\n",
    "df_degrees['degree'] = degrees\n",
    "df_degrees=df_degrees.sort_values(by='degree')\n",
    "df_degrees"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEtCAYAAADk97CmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deZxcVZn/8c/TazpLZ0/IShDCEhLWNiD4U1QYkGHfjKAsglEGHdxmFGZGGH/DyDgI8xMRBwQTlEUUkEVRGQZxAbKyhLAkgYSQhc4CSbqzdHp5fn/c00nRqa69a/2+X6/7qlun7lP31L3VT98699xzzd0REZHKUFXoCoiISP4o6YuIVBAlfRGRCqKkLyJSQZT0RUQqSE2hK5DMiBEjfNKkSYWuhohISVmwYMEGdx/Zs7zok/6kSZOYP39+oashIlJSzOyteOVq3hERqSBK+iIiFURJX0Skgijpi4hUECV9EZEKoqQvIlJBlPRFRCqIkr6ISJFZtq6V7/3uNfpi6HslfRGRIvL7xe9wxi1/5Rfz3mbN5h05f/+ivyJXRKQSdHY5Nz2xhB8+tYxDxg/mx585krFDGnK+HiV9EZEC27RtJ1fe9wJPL1nPeU3j+c7pU+lXW90n61LSFxEpoFfWbOGLP1/A2s3bue7MqZw/fSJm1mfrU9IXESmQh19YzTcfeInBDbX84gsf4oiJQ/t8nUr6IiJ51t7ZxfWPv8Ydf1nO9EnD+OEFhzNqUL+8rFtJX0Qkjza0tnHF3QuZs/xdLj5mEv/0twdRW52/jpRK+iIiefLC25u4/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ggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(df_degrees['degree'].values)\n",
    "plt.xticks(list(range(df_degrees.shape[0])), df_degrees['feature'].values, rotation=90)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "ordered_features = df_degrees['feature'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Bundle():\n",
    "    feature_names = []\n",
    "    n_conflicts = 0\n",
    "    occupied_places=np.array([])\n",
    "    \n",
    "    \n",
    "    def __init__(self):\n",
    "        self.feature_names = []\n",
    "        self.occupied_places=None\n",
    "        \n",
    "        pass\n",
    "    \n",
    "    def add(self, feature_name, feature_value):\n",
    "        self.feature_names.append(feature_name)\n",
    "        \n",
    "        \n",
    "        if self.occupied_places is None:\n",
    "            self.occupied_places = (feature_value > 0) * 1\n",
    "        else:\n",
    "            self.n_conflicts = np.sum((self.occupied_places * feature_value)>0)\n",
    "            self.occupied_places = ((self.occupied_places + feature_value)>0) * 1\n",
    "            \n",
    "\n",
    "    def conflict_count(self, f):\n",
    "        cc=np.sum(self.occupied_places * f>0)\n",
    "        return cc\n",
    " \n",
    "    def get_n_occupied_places(self):\n",
    "        return np.sum(self.occupied_places)\n",
    "    \n",
    "    def generate_feature(self, df_binaries):\n",
    "        n_features = len(self.feature_names)\n",
    "        n_samples = len(self.occupied_places)\n",
    "        bv = np.zeros((n_samples))\n",
    "        for f in range(n_features):\n",
    "            fv = df_binaries[self.feature_names[f]].values * (f+1)\n",
    "            bv = bv*(bv>=fv) + fv*(fv>bv)\n",
    "        return bv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "bundles = []\n",
    "max_conflict_count=5\n",
    "\n",
    "for i in range(len(ordered_features)):\n",
    "    need_new = True\n",
    "    \n",
    "    for j in range(len(bundles)):\n",
    "        conflict_count = bundles[j].conflict_count(df_binaries[ordered_features[i]].values)\n",
    "        \n",
    "        if conflict_count<max_conflict_count:\n",
    "            bundles[j].add(ordered_features[i], df_binaries[ordered_features[i]].values)\n",
    "            need_new=False\n",
    "            break\n",
    "    \n",
    "    if need_new:\n",
    "        b = Bundle()\n",
    "        b.add(ordered_features[i], df_binaries[ordered_features[i]].values)\n",
    "        bundles.append(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['SibSp_7', 'SibSp_6', 'Parch_6', 'Parch_4', 'Parch_5', 'Parch_3', 'SibSp_5', 'SibSp_8', 'SibSp_3', 'SibSp_4', 'SibSp_2', 'SibSp_0']\n",
      "4\n",
      "['Embarked_Q', 'Parch_2']\n",
      "1\n",
      "['Parch_1', 'Parch_0']\n",
      "0\n",
      "['Embarked_C', 'Embarked_S']\n",
      "0\n",
      "['Pclass_2', 'Pclass_1', 'Pclass_3']\n",
      "0\n",
      "['SibSp_1']\n",
      "0\n",
      "['Sex']\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "for b in bundles:\n",
    "    print(b.feature_names)\n",
    "    print(b.n_conflicts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "discretizer = KBinsDiscretizer(n_bins=10, encode='ordinal', strategy='kmeans')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "new_fare=discretizer.fit_transform(df['Fare'].values.reshape((-1, 1)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['Fare'] = new_fare"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Merge Exclusive Features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_bundles = pd.DataFrame()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(len(bundles)):\n",
    "    df_bundles[f'b{i}'] = bundles[i].generate_feature(df_binaries)\n",
    "    df_bundles[f'b{i}'] = df_bundles[f'b{i}'].astype(int)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>b0</th>\n",
       "      <th>b1</th>\n",
       "      <th>b2</th>\n",
       "      <th>b3</th>\n",
       "      <th>b4</th>\n",
       "      <th>b5</th>\n",
       "      <th>b6</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     b0  b1  b2  b3  b4  b5  b6\n",
       "0     0   0   2   2   3   1   1\n",
       "1     0   0   2   1   2   1   0\n",
       "2    12   0   2   2   3   0   0\n",
       "3     0   0   2   2   2   1   0\n",
       "4    12   0   2   2   3   0   1\n",
       "..   ..  ..  ..  ..  ..  ..  ..\n",
       "886  12   0   2   2   1   0   1\n",
       "887  12   0   2   2   2   0   0\n",
       "888   0   2   0   2   3   1   0\n",
       "889  12   0   2   1   2   0   1\n",
       "890  12   1   2   0   3   0   1\n",
       "\n",
       "[891 rows x 7 columns]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_bundles"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>b0</th>\n",
       "      <th>b1</th>\n",
       "      <th>b2</th>\n",
       "      <th>b3</th>\n",
       "      <th>b4</th>\n",
       "      <th>b5</th>\n",
       "      <th>b6</th>\n",
       "      <th>fare</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   b0  b1  b2  b3  b4  b5  b6  fare\n",
       "0   0   0   2   2   3   1   1     0\n",
       "1   0   0   2   1   2   1   0     3\n",
       "2  12   0   2   2   3   0   0     0\n",
       "3   0   0   2   2   2   1   0     2\n",
       "4  12   0   2   2   3   0   1     0"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_features = df_bundles.copy()\n",
    "df_features['fare'] = df['Fare']\n",
    "df_features['fare'] = df_features['fare'].astype(int)\n",
    "df_features.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "X = df_features.values\n",
    "y = df['Survived'].values\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>b0</th>\n",
       "      <th>b1</th>\n",
       "      <th>b2</th>\n",
       "      <th>b3</th>\n",
       "      <th>b4</th>\n",
       "      <th>b5</th>\n",
       "      <th>b6</th>\n",
       "      <th>fare</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     b0  b1  b2  b3  b4  b5  b6  fare  y\n",
       "0    12   0   2   2   3   0   0     0  0\n",
       "1    12   0   2   2   2   0   1     1  1\n",
       "2    12   0   1   2   2   0   0     7  1\n",
       "3    12   0   2   1   3   0   1     0  0\n",
       "4    12   0   2   2   3   0   1     0  0\n",
       "..   ..  ..  ..  ..  ..  ..  ..   ... ..\n",
       "663  12   0   2   2   3   0   1     0  0\n",
       "664   0   0   2   2   1   1   1     1  0\n",
       "665  12   0   2   1   3   0   1     0  0\n",
       "666  12   0   2   2   3   0   1     0  0\n",
       "667  12   0   1   2   3   0   0     0  1\n",
       "\n",
       "[668 rows x 9 columns]"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_train = pd.DataFrame(data=X_train, columns=df_features.columns)\n",
    "df_train['y'] = y_train\n",
    "df_train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "feature_names = df_features.columns\n",
    "n_train = len(y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# LGB Tree"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "class SplitResult():\n",
    "    similarity=0\n",
    "    similarity_gain=0\n",
    "    i_feature=-1\n",
    "    split_value=None\n",
    "    split_quantile=0\n",
    "    # left\n",
    "    left_X=None\n",
    "    left_y=None\n",
    "    left_y_previous=None\n",
    "    left_w=None\n",
    "    left_similarity=0\n",
    "    left_n=0\n",
    "    # right\n",
    "    right_X=None\n",
    "    right_y=None\n",
    "    right_y_previous=None\n",
    "    right_w=None\n",
    "    right_similarity=0\n",
    "    right_n=0\n",
    "    \n",
    "class Branch:\n",
    "    no=0\n",
    "    depth=1\n",
    "    i_feature=-1\n",
    "    split_value=0\n",
    "    split_quantile=0\n",
    "    similarity=0\n",
    "    similarity_gain=0\n",
    "    n_samples=0\n",
    "    value=[]\n",
    "    X=None\n",
    "    y=None\n",
    "    y_previous=None\n",
    "    w=None\n",
    "    \n",
    "    \n",
    "    left_branch=None\n",
    "    right_branch=None\n",
    "    \n",
    "    def value(self, _lambda):\n",
    "        \n",
    "        return np.sum(self.y * self.w)/(np.sum(self.y_previous * (1 - self.y_previous) * self.w)+_lambda)\n",
    "\n",
    "    \n",
    "    def is_leaf(self):\n",
    "        return self.left_branch is None and self.right_branch is None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "def generate_keep(probability, n):\n",
    "    return probability>np.random.rand(n)\n",
    "\n",
    "def goss(X, r, p, top_rate=1, keep_rate=1):\n",
    "    df_tmp = pd.DataFrame(data=X)\n",
    "    df_tmp['r'] = r\n",
    "    df_tmp['p'] = p\n",
    "    df_tmp.sort_values(by=['r'], ascending=False, inplace=True)\n",
    "    df_tmp['keep'] = generate_keep(keep_rate, df_tmp.shape[0])\n",
    "    df_tmp['w'] = 1 / keep_rate\n",
    "    \n",
    "    top_min = np.quantile(r, top_rate)\n",
    "    df_tmp.loc[df_tmp['r']>top_min, 'keep'] = True\n",
    "    df_tmp.loc[df_tmp['r']>top_min, 'w'] = 1\n",
    "    \n",
    "    df_tmp = df_tmp[df_tmp['keep']==True]\n",
    "    X_train_goss = df_tmp.drop(['r','p','w'], axis=1).values\n",
    "    #y_train_goss = df_tmp['y'].values\n",
    "    r_train_goss = df_tmp['r'].values\n",
    "    p_train_goss = df_tmp['p'].values\n",
    "    w_train_goss = df_tmp['w'].values\n",
    "    \n",
    "    return X_train_goss, r_train_goss, p_train_goss, w_train_goss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import r2_score\n",
    "class LGBTree():\n",
    "    \n",
    "    _lambda=1\n",
    "    node_number=0\n",
    "    the_tree=None\n",
    "    max_depth=3\n",
    "    gamma=2\n",
    "    colsample_bynode=1.0\n",
    "    \n",
    "    def __init__(self, max_depth=3, _lambda=1, gamma=2, colsample_bynode=1.0):\n",
    "        \n",
    "        self.max_depth = max_depth\n",
    "        self._lambda =_lambda\n",
    "        self.gamma = gamma\n",
    "        self.colsample_bynode = colsample_bynode\n",
    "\n",
    "    def get_similarity(self, y, y_previous, w):\n",
    "        #a=np.array(a)\n",
    "        sim=np.sum(y * w)**2/(np.sum(y_previous * (1-y_previous) * w)+self._lambda)\n",
    "\n",
    "        return sim\n",
    "    \n",
    "    def get_colsample_bynode_indics(self, n_features):\n",
    "        if n_features==1:\n",
    "            return [1]\n",
    "\n",
    "        if self.colsample_bynode>1:\n",
    "            raise ValueError(\"colsample_bynode must be smaller than or equal to 1.0\")\n",
    "\n",
    "        n_selected_features=int(self.colsample_bynode * n_features)\n",
    "        if n_selected_features==n_features:\n",
    "            return list(range(n_features))\n",
    "\n",
    "\n",
    "        old_list=list(range(n_features))\n",
    "        new_list=[]\n",
    "        for i in range(n_selected_features):\n",
    "            selected = random.choice(old_list)\n",
    "            while selected in new_list:\n",
    "                selected = random.choice(old_list)\n",
    "            new_list.append(selected)\n",
    "        return new_list\n",
    "    \n",
    "    def find_best_split(self, X, y, y_previous, w):\n",
    "        n_features=X.shape[1]\n",
    "        best_sr=SplitResult()\n",
    "        # colsample_bynode\n",
    "        selected_features = self.get_colsample_bynode_indics(n_features)\n",
    "        for i_feature in selected_features:\n",
    "            f=X[:,i_feature]\n",
    "            for split_value in range(1, int(np.max(f))):\n",
    "                sr = SplitResult()\n",
    "                sr.i_feature=i_feature\n",
    "                condition = f<split_value\n",
    "                #print(condition)\n",
    "                # left\n",
    "                sr.left_y = y[condition]\n",
    "                sr.left_y_previous=y_previous[condition]\n",
    "                sr.left_w = w[condition]\n",
    "                sr.left_n = len(sr.left_y)\n",
    "                if sr.left_n == 0:\n",
    "                    continue\n",
    "                sr.left_similarity = self.get_similarity(sr.left_y, sr.left_y_previous, sr.left_w)\n",
    "\n",
    "                # right\n",
    "                sr.right_y = y[~condition]\n",
    "                sr.right_y_previous=y_previous[~condition]\n",
    "                sr.right_w = w[~condition]\n",
    "                sr.right_n = len(sr.right_y)\n",
    "                if sr.right_n == 0:\n",
    "                    continue\n",
    "                sr.right_similarity = self.get_similarity(sr.right_y, sr.right_y_previous, sr.right_w)\n",
    "\n",
    "                sr.similarity = sr.left_similarity + sr.right_similarity\n",
    "                #sr.print_me()\n",
    "                if sr.similarity>best_sr.similarity:\n",
    "                    best_sr=sr\n",
    "                    best_sr.left_X = X[condition,:]\n",
    "                    best_sr.right_X = X[~condition,:]\n",
    "                    best_sr.split_value = split_value\n",
    "        return best_sr\n",
    "    \n",
    "\n",
    "    def fit_inner(self, X, y, y_previous, w, depth, branch_similarity):\n",
    "        branch = Branch()\n",
    "        branch.no=self.node_number\n",
    "        self.node_number+=1\n",
    "        branch.similarity=branch_similarity\n",
    "        branch.n_samples = len(y)\n",
    "        branch.X=X\n",
    "        branch.y=y\n",
    "        branch.y_previous = y_previous\n",
    "        branch.w = w\n",
    "\n",
    "        if depth==self.max_depth:\n",
    "            #print(\"leaf\")\n",
    "\n",
    "            return branch\n",
    "        else:\n",
    "            sr=self.find_best_split(X, y, y_previous, w)\n",
    "            if sr.i_feature==-1:\n",
    "                return branch\n",
    "\n",
    "            sr.similarity_gain=sr.similarity-branch_similarity\n",
    "\n",
    "            #sr.print_me()\n",
    "            branch.i_feature=sr.i_feature\n",
    "            branch.split_value = sr.split_value\n",
    "            branch.similarity_gain=sr.similarity_gain\n",
    "            #print(\"branch\")\n",
    "            branch.left_branch=self.fit_inner(sr.left_X, sr.left_y, sr.left_y_previous, sr.left_w, depth+1, branch_similarity=sr.left_similarity)\n",
    "            branch.right_branch=self.fit_inner(sr.right_X, sr.right_y, sr.right_y_previous, sr.right_w, depth+1, branch_similarity=sr.right_similarity)\n",
    "\n",
    "            return branch\n",
    "        \n",
    "    def fit(self, X, y, y_previous):\n",
    "        X_goss, y_goss, y_previous_goss, w = goss(X, y, y_previous)\n",
    "        self.node_number=0\n",
    "        similarity=self.get_similarity(y_goss, y_previous_goss, w)\n",
    "        self.tree=self.fit_inner(X_goss, y_goss, y_previous_goss, w, 0, branch_similarity=similarity)\n",
    "        \n",
    "    def prune_inner(self, b: Branch):\n",
    "        if b.is_leaf():\n",
    "            return\n",
    "        self.prune_inner(b.left_branch)\n",
    "        self.prune_inner(b.right_branch)\n",
    "        if b.left_branch.is_leaf() and b.right_branch.is_leaf():\n",
    "            if b.similarity_gain<self.gamma:\n",
    "                b.left_branch=None\n",
    "                b.right_branch=None\n",
    "        \n",
    "    def prune(self):\n",
    "        self.prune_inner(self.tree)\n",
    "        \n",
    "    def predict_one_inner(self, tree:Branch, x):\n",
    "        if tree.is_leaf():\n",
    "            return tree.value(self._lambda)\n",
    "        if x[tree.i_feature]<tree.split_value:\n",
    "            return self.predict_one_inner(tree.left_branch, x)\n",
    "        else:\n",
    "            return self.predict_one_inner(tree.right_branch, x)\n",
    "\n",
    "    def predict_inner(self, tree:Branch, X):\n",
    "        y=[]\n",
    "        for x in X:\n",
    "            t=self.predict_one_inner(tree, x)\n",
    "            y.append(t)\n",
    "        return np.array(y)\n",
    "\n",
    "    def predict(self, X):\n",
    "        return self.predict_inner(self.tree, X)\n",
    "    \n",
    "    def score(self, X, y):\n",
    "        y_hat = self.predict(X)\n",
    "        return r2_score(y, y_hat)\n",
    "\n",
    "    def export_graphviz_inner(self, the_branch:Branch, dot_data:str):\n",
    "        fillcolor = \"#ffffff\"\n",
    "        if the_branch.similarity_gain < self.gamma:\n",
    "            fillcolor = \"#ffaaaa\"\n",
    "        if the_branch.similarity_gain < 0:\n",
    "            fillcolor = \"#ff4444\"\n",
    "\n",
    "        if the_branch.is_leaf():\n",
    "            n_positive = sum(the_branch.y>=0)\n",
    "            n_negative = sum(the_branch.y<0)\n",
    "            dot_data += f\"{the_branch.no} [label=\\\"{the_branch.no}\\n\"+ \\\n",
    "            f\"samples={the_branch.n_samples:0.0f}\\\\n\" + \\\n",
    "            f\"+/- = {n_positive}/{n_negative}\\\\n\" + \\\n",
    "            f\"value={the_branch.value(self._lambda):0.3f}\\\\n\" + \\\n",
    "            f\"\\\", fillcolor=\\\"#22ee22\\\"];\"\n",
    "        else:\n",
    "            dot_data += f\"{the_branch.no} [label=\\\"{the_branch.no}\\n\"+ \\\n",
    "            f\"{feature_names[the_branch.i_feature]} <= {the_branch.split_value:0.0f}\\\\n\" + \\\n",
    "            f\"samples = {the_branch.n_samples:0.0f}\\\\n\" + \\\n",
    "            f\"sim_gain = {the_branch.similarity_gain:0.3f}\\\\n\" + \\\n",
    "            f\"\\\", fillcolor=\\\"{fillcolor}\\\"];\"\n",
    "        #print(branch_str)\n",
    "        if not the_branch.left_branch is None:\n",
    "            left_branch=the_branch.left_branch\n",
    "            if left_branch.no>0:\n",
    "                dot_data += f\"{the_branch.no} -> {left_branch.no} ;\"\n",
    "                dot_data = self.export_graphviz_inner(left_branch, dot_data)\n",
    "        if not the_branch.right_branch is None:\n",
    "            right_branch=the_branch.right_branch\n",
    "            if right_branch.no>0:\n",
    "                dot_data += f\"{the_branch.no} -> {right_branch.no} ;\"\n",
    "                dot_data = self.export_graphviz_inner(right_branch, dot_data)\n",
    "        return dot_data\n",
    "\n",
    "    def export_graphviz(self):\n",
    "        dot_data=\"\"\"digraph Tree {\\nnode [shape=box, style=\"filled, rounded\", color=\"black\", fontname=helvetica] ;\\nedge [fontname=helvetica] ;\\n\"\"\"\n",
    "        dot_data+=self.export_graphviz_inner(self.tree, \"\")\n",
    "        dot_data+=\"}\"\n",
    "        dot_data=dot_data.replace(\"\\r\\n\",\"\\n\")\n",
    "        return dot_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_train0 = np.array([0.5] * len(y_train)) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"922pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 922.00 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 918,-384 918,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M513.5,-380C513.5,-380 403.5,-380 403.5,-380 397.5,-380 391.5,-374 391.5,-368 391.5,-368 391.5,-324 391.5,-324 391.5,-318 397.5,-312 403.5,-312 403.5,-312 513.5,-312 513.5,-312 519.5,-312 525.5,-318 525.5,-324 525.5,-324 525.5,-368 525.5,-368 525.5,-374 519.5,-380 513.5,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.525</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M420.5,-276C420.5,-276 318.5,-276 318.5,-276 312.5,-276 306.5,-270 306.5,-264 306.5,-264 306.5,-220 306.5,-220 306.5,-214 312.5,-208 318.5,-208 318.5,-208 420.5,-208 420.5,-208 426.5,-208 432.5,-214 432.5,-220 432.5,-220 432.5,-264 432.5,-264 432.5,-270 426.5,-276 420.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.545</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M429.604,-311.884C421.832,-302.976 413.333,-293.235 405.237,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"407.767,-281.533 398.555,-276.299 402.493,-286.135 407.767,-281.533\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M602.5,-276C602.5,-276 492.5,-276 492.5,-276 486.5,-276 480.5,-270 480.5,-264 480.5,-264 480.5,-220 480.5,-220 480.5,-214 486.5,-208 492.5,-208 492.5,-208 602.5,-208 602.5,-208 608.5,-208 614.5,-214 614.5,-220 614.5,-220 614.5,-264 614.5,-264 614.5,-270 608.5,-276 602.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 16.119</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M487.396,-311.884C495.168,-302.976 503.667,-293.235 511.763,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"514.507,-286.135 518.445,-276.299 509.233,-281.533 514.507,-286.135\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M215.5,-172C215.5,-172 113.5,-172 113.5,-172 107.5,-172 101.5,-166 101.5,-160 101.5,-160 101.5,-116 101.5,-116 101.5,-110 107.5,-104 113.5,-104 113.5,-104 215.5,-104 215.5,-104 221.5,-104 227.5,-110 227.5,-116 227.5,-116 227.5,-160 227.5,-160 227.5,-166 221.5,-172 215.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b3 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.841</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M306.321,-209.564C284.4,-198.658 259.652,-186.344 237.037,-175.091\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"238.336,-171.829 227.824,-170.507 235.218,-178.096 238.336,-171.829\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M420.5,-172C420.5,-172 318.5,-172 318.5,-172 312.5,-172 306.5,-166 306.5,-160 306.5,-160 306.5,-116 306.5,-116 306.5,-110 312.5,-104 318.5,-104 318.5,-104 420.5,-104 420.5,-104 426.5,-104 432.5,-110 432.5,-116 432.5,-116 432.5,-160 432.5,-160 432.5,-166 426.5,-172 420.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 371</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.553</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M369.5,-207.884C369.5,-199.778 369.5,-190.982 369.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"373,-182.299 369.5,-172.299 366,-182.299 373,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 0/1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.400</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127.163,-103.884C116.819,-94.7089 105.478,-84.6503 94.7364,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"96.8471,-72.3165 87.0434,-68.2994 92.2022,-77.5534 96.8471,-72.3165\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.667</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M164.5,-103.884C164.5,-95.7778 164.5,-86.982 164.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"168,-78.2993 164.5,-68.2994 161,-78.2994 168,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M317,-68C317,-68 242,-68 242,-68 236,-68 230,-62 230,-56 230,-56 230,-12 230,-12 230,-6 236,-0 242,-0 242,-0 317,-0 317,-0 323,-0 329,-6 329,-12 329,-12 329,-56 329,-56 329,-62 323,-68 317,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 27/48</text>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.532</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M340.28,-103.884C332.42,-94.9762 323.825,-85.2354 315.638,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"318.122,-73.4821 308.882,-68.2994 312.874,-78.1135 318.122,-73.4821\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M439.5,-68C439.5,-68 359.5,-68 359.5,-68 353.5,-68 347.5,-62 347.5,-56 347.5,-56 347.5,-12 347.5,-12 347.5,-6 353.5,-0 359.5,-0 359.5,-0 439.5,-0 439.5,-0 445.5,-0 451.5,-6 451.5,-12 451.5,-12 451.5,-56 451.5,-56 451.5,-62 445.5,-68 439.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=296</text>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 68/228</text>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.067</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M379.24,-103.884C381.677,-95.5997 384.325,-86.5951 386.879,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"390.242,-78.8806 389.706,-68.2994 383.527,-76.9054 390.242,-78.8806\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M598.5,-172C598.5,-172 496.5,-172 496.5,-172 490.5,-172 484.5,-166 484.5,-160 484.5,-160 484.5,-116 484.5,-116 484.5,-110 490.5,-104 496.5,-104 496.5,-104 598.5,-104 598.5,-104 604.5,-104 610.5,-110 610.5,-116 610.5,-116 610.5,-160 610.5,-160 610.5,-166 604.5,-172 598.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.244</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M547.5,-207.884C547.5,-199.778 547.5,-190.982 547.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"551,-182.299 547.5,-172.299 544,-182.299 551,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M804.5,-172C804.5,-172 702.5,-172 702.5,-172 696.5,-172 690.5,-166 690.5,-160 690.5,-160 690.5,-116 690.5,-116 690.5,-110 696.5,-104 702.5,-104 702.5,-104 804.5,-104 804.5,-104 810.5,-104 816.5,-110 816.5,-116 816.5,-116 816.5,-160 816.5,-160 816.5,-166 810.5,-172 804.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.645</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M614.382,-207.884C635.764,-197.296 659.523,-185.532 681.268,-174.765\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"683.043,-177.792 690.451,-170.218 679.936,-171.519 683.043,-177.792\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M553,-68C553,-68 482,-68 482,-68 476,-68 470,-62 470,-56 470,-56 470,-12 470,-12 470,-6 476,-0 482,-0 482,-0 553,-0 553,-0 559,-0 565,-6 565,-12 565,-12 565,-56 565,-56 565,-62 559,-68 553,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=65</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 37/28</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.261</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M537.76,-103.884C535.323,-95.5997 532.675,-86.5951 530.121,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"533.473,-76.9054 527.294,-68.2994 526.758,-78.8806 533.473,-76.9054\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M675.5,-68C675.5,-68 595.5,-68 595.5,-68 589.5,-68 583.5,-62 583.5,-56 583.5,-56 583.5,-12 583.5,-12 583.5,-6 589.5,-0 595.5,-0 595.5,-0 675.5,-0 675.5,-0 681.5,-0 687.5,-6 687.5,-12 687.5,-12 687.5,-56 687.5,-56 687.5,-62 681.5,-68 675.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=150</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 62/88</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.338</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M576.071,-103.884C583.756,-94.9762 592.16,-85.2354 600.165,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"602.889,-78.1573 606.771,-68.2994 597.589,-73.5846 602.889,-78.1573\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M789,-68C789,-68 718,-68 718,-68 712,-68 706,-62 706,-56 706,-56 706,-12 706,-12 706,-6 712,-0 718,-0 718,-0 789,-0 789,-0 795,-0 801,-6 801,-12 801,-12 801,-56 801,-56 801,-62 795,-68 789,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=16</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 10/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.400</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M753.5,-103.884C753.5,-95.7778 753.5,-86.982 753.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"757,-78.2993 753.5,-68.2994 750,-78.2994 757,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M902,-68C902,-68 831,-68 831,-68 825,-68 819,-62 819,-56 819,-56 819,-12 819,-12 819,-6 825,-0 831,-0 831,-0 902,-0 902,-0 908,-0 914,-6 914,-12 914,-12 914,-56 914,-56 914,-62 908,-68 902,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=57</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 44/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.016</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M790.188,-103.884C800.352,-94.7089 811.495,-84.6503 822.05,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"824.532,-77.598 829.61,-68.2994 819.841,-72.4018 824.532,-77.598\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055fe4640>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "lt = LGBTree()\n",
    "lt.fit(X_train, y_train-y_train0, y_train0)\n",
    "dot_data=lt.export_graphviz()\n",
    "graph = graphviz.Source(dot_data) \n",
    "display(graph)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"506pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 506.00 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 502,-384 502,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M303.5,-380C303.5,-380 193.5,-380 193.5,-380 187.5,-380 181.5,-374 181.5,-368 181.5,-368 181.5,-324 181.5,-324 181.5,-318 187.5,-312 193.5,-312 193.5,-312 303.5,-312 303.5,-312 309.5,-312 315.5,-318 315.5,-324 315.5,-324 315.5,-368 315.5,-368 315.5,-374 309.5,-380 303.5,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"248.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"248.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"248.5\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"248.5\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.525</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M225.5,-276C225.5,-276 123.5,-276 123.5,-276 117.5,-276 111.5,-270 111.5,-264 111.5,-264 111.5,-220 111.5,-220 111.5,-214 117.5,-208 123.5,-208 123.5,-208 225.5,-208 225.5,-208 231.5,-208 237.5,-214 237.5,-220 237.5,-220 237.5,-264 237.5,-264 237.5,-270 231.5,-276 225.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"174.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.545</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M224.474,-311.884C218.141,-303.154 211.228,-293.625 204.618,-284.514\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"207.364,-282.338 198.658,-276.299 201.698,-286.449 207.364,-282.338\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M377.5,-276C377.5,-276 267.5,-276 267.5,-276 261.5,-276 255.5,-270 255.5,-264 255.5,-264 255.5,-220 255.5,-220 255.5,-214 261.5,-208 267.5,-208 267.5,-208 377.5,-208 377.5,-208 383.5,-208 389.5,-214 389.5,-220 389.5,-220 389.5,-264 389.5,-264 389.5,-270 383.5,-276 377.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"322.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"322.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"322.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"322.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 16.119</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M272.526,-311.884C278.859,-303.154 285.772,-293.625 292.382,-284.514\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"295.302,-286.449 298.342,-276.299 289.636,-282.338 295.302,-286.449\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-172C83,-172 12,-172 12,-172 6,-172 0,-166 0,-160 0,-160 0,-116 0,-116 0,-110 6,-104 12,-104 12,-104 83,-104 83,-104 89,-104 95,-110 95,-116 95,-116 95,-160 95,-160 95,-166 89,-172 83,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.462</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M133.267,-207.884C121.622,-198.531 108.833,-188.259 96.7665,-178.568\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"98.9494,-175.832 88.961,-172.299 94.566,-181.29 98.9494,-175.832\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M227.5,-172C227.5,-172 125.5,-172 125.5,-172 119.5,-172 113.5,-166 113.5,-160 113.5,-160 113.5,-116 113.5,-116 113.5,-110 119.5,-104 125.5,-104 125.5,-104 227.5,-104 227.5,-104 233.5,-104 239.5,-110 239.5,-116 239.5,-116 239.5,-160 239.5,-160 239.5,-166 233.5,-172 227.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"176.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"176.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"176.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 371</text>\r\n",
       "<text text-anchor=\"middle\" x=\"176.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.553</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M175.149,-207.884C175.308,-199.778 175.481,-190.982 175.648,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"179.15,-182.366 175.847,-172.299 172.152,-182.229 179.15,-182.366\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M101,-68C101,-68 26,-68 26,-68 20,-68 14,-62 14,-56 14,-56 14,-12 14,-12 14,-6 20,-0 26,-0 26,-0 101,-0 101,-0 107,-0 113,-6 113,-12 113,-12 113,-56 113,-56 113,-62 107,-68 101,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"63.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"63.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"63.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 27/48</text>\r\n",
       "<text text-anchor=\"middle\" x=\"63.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.532</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M139.812,-103.884C129.648,-94.7089 118.505,-84.6503 107.95,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"110.159,-72.4018 100.39,-68.2994 105.468,-77.598 110.159,-72.4018\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M223.5,-68C223.5,-68 143.5,-68 143.5,-68 137.5,-68 131.5,-62 131.5,-56 131.5,-56 131.5,-12 131.5,-12 131.5,-6 137.5,-0 143.5,-0 143.5,-0 223.5,-0 223.5,-0 229.5,-0 235.5,-6 235.5,-12 235.5,-12 235.5,-56 235.5,-56 235.5,-62 229.5,-68 223.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"183.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"183.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=296</text>\r\n",
       "<text text-anchor=\"middle\" x=\"183.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 68/228</text>\r\n",
       "<text text-anchor=\"middle\" x=\"183.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.067</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M178.773,-103.884C179.329,-95.7778 179.933,-86.982 180.517,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"184.022,-78.5156 181.215,-68.2994 177.038,-78.0362 184.022,-78.5156\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M372.5,-172C372.5,-172 270.5,-172 270.5,-172 264.5,-172 258.5,-166 258.5,-160 258.5,-160 258.5,-116 258.5,-116 258.5,-110 264.5,-104 270.5,-104 270.5,-104 372.5,-104 372.5,-104 378.5,-104 384.5,-110 384.5,-116 384.5,-116 384.5,-160 384.5,-160 384.5,-166 378.5,-172 372.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"321.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"321.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"321.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"321.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.244</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M322.175,-207.884C322.096,-199.778 322.01,-190.982 321.926,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"325.424,-182.265 321.826,-172.299 318.425,-182.333 325.424,-182.265\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M486,-172C486,-172 415,-172 415,-172 409,-172 403,-166 403,-160 403,-160 403,-116 403,-116 403,-110 409,-104 415,-104 415,-104 486,-104 486,-104 492,-104 498,-110 498,-116 498,-116 498,-160 498,-160 498,-166 492,-172 486,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"450.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"450.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"450.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 54/19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"450.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.909</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M364.058,-207.884C375.795,-198.531 388.684,-188.259 400.846,-178.568\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"403.073,-181.269 408.713,-172.299 398.711,-175.794 403.073,-181.269\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M350,-68C350,-68 279,-68 279,-68 273,-68 267,-62 267,-56 267,-56 267,-12 267,-12 267,-6 273,-0 279,-0 279,-0 350,-0 350,-0 356,-0 362,-6 362,-12 362,-12 362,-56 362,-56 362,-62 356,-68 350,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"314.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"314.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=65</text>\r\n",
       "<text text-anchor=\"middle\" x=\"314.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 37/28</text>\r\n",
       "<text text-anchor=\"middle\" x=\"314.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.261</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M319.227,-103.884C318.671,-95.7778 318.067,-86.982 317.483,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"320.962,-78.0362 316.785,-68.2994 313.978,-78.5156 320.962,-78.0362\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M472.5,-68C472.5,-68 392.5,-68 392.5,-68 386.5,-68 380.5,-62 380.5,-56 380.5,-56 380.5,-12 380.5,-12 380.5,-6 386.5,-0 392.5,-0 392.5,-0 472.5,-0 472.5,-0 478.5,-0 484.5,-6 484.5,-12 484.5,-12 484.5,-56 484.5,-56 484.5,-62 478.5,-68 472.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"432.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"432.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=150</text>\r\n",
       "<text text-anchor=\"middle\" x=\"432.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 62/88</text>\r\n",
       "<text text-anchor=\"middle\" x=\"432.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.338</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M357.539,-103.884C367.523,-94.7089 378.469,-84.6503 388.837,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"391.267,-77.6428 396.262,-68.2994 386.531,-72.4885 391.267,-77.6428\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055ffbac0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "lt.prune()\n",
    "dot_data=lt.export_graphviz()\n",
    "graph = graphviz.Source(dot_data) \n",
    "display(graph)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step 1 Average"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>b0</th>\n",
       "      <th>b1</th>\n",
       "      <th>b2</th>\n",
       "      <th>b3</th>\n",
       "      <th>b4</th>\n",
       "      <th>b5</th>\n",
       "      <th>b6</th>\n",
       "      <th>fare</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     b0  b1  b2  b3  b4  b5  b6  fare  y\n",
       "0    12   0   2   2   3   0   0     0  0\n",
       "1    12   0   2   2   2   0   1     1  1\n",
       "2    12   0   1   2   2   0   0     7  1\n",
       "3    12   0   2   1   3   0   1     0  0\n",
       "4    12   0   2   2   3   0   1     0  0\n",
       "..   ..  ..  ..  ..  ..  ..  ..   ... ..\n",
       "663  12   0   2   2   3   0   1     0  0\n",
       "664   0   0   2   2   1   1   1     1  0\n",
       "665  12   0   2   1   3   0   1     0  0\n",
       "666  12   0   2   2   3   0   1     0  0\n",
       "667  12   0   1   2   3   0   0     0  1\n",
       "\n",
       "[668 rows x 9 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.6931471805599453\n"
     ]
    }
   ],
   "source": [
    "#now let's get started\n",
    "learning_rate=0.3\n",
    "loss = [0] * 6\n",
    "residuals = np.zeros([6,n_train])\n",
    "probabilities = np.zeros([6,n_train])\n",
    "predictions = np.zeros([6,n_train])\n",
    "log_of_odds = np.zeros([6,n_train])\n",
    "gamma = np.zeros([6,n_train])\n",
    "log_of_odds[0] = [0] * n_train\n",
    "#calculation\n",
    "#average_y=y.mean()\n",
    "probabilities[0] = [0.5] * n_train\n",
    "predictions[0] = [1] * n_train\n",
    "residuals[0] = y_train - probabilities[0]\n",
    "df_display=pd.DataFrame()\n",
    "df_display['y'] = y_train\n",
    "df_display['$f_0$']=np.array(predictions[0]).reshape((-1, 1))\n",
    "df_display['$r_0$']=np.array(residuals[0]).reshape((-1, 1))\n",
    "display(df_train)\n",
    "loss0=-(y_train*np.log(probabilities[0])+(1-y_train)*np.log(1-probabilities[0]))\n",
    "loss[0] = np.sum(loss0) / n_train\n",
    "print(loss[0])\n",
    "trees = []"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the first step, we calculate the average 71.2 as the initial prediction. The pseudo residuals are 16.8, 4.8, etc."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step 2 For Loop"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "def iterate(i):\n",
    "    \n",
    "    t = LGBTree(max_depth=3, gamma=5)\n",
    "    t.fit(X_train, residuals[i], probabilities[i])\n",
    "    trees.append(t)\n",
    "    \n",
    "    dot_data = t.export_graphviz()\n",
    "    graph = graphviz.Source(dot_data) \n",
    "    display(graph)\n",
    "    t.prune()\n",
    "    dot_data = t.export_graphviz()\n",
    "    graph = graphviz.Source(dot_data) \n",
    "    display(graph)\n",
    "    #next prediction, residual\n",
    "    gamma[i]=t.predict(X_train)\n",
    "    log_of_odds[i+1] = log_of_odds[i] + 0.3 * gamma[i]\n",
    "    probabilities[i+1] = np.array([np.exp(odds)/(np.exp(odds)+1) for odds in log_of_odds[i+1]])\n",
    "    predictions[i+1] = (probabilities[i+1]>0.5)*1.0\n",
    "    residuals[i+1]=y_train-probabilities[i+1]\n",
    "    loss[i+1]=np.sum(-y_train * log_of_odds[i+1] + np.log(1+np.exp(log_of_odds[i+1])))\n",
    "    loss[i+1]=loss[i+1]/n_train\n",
    "    y_hat=t.predict(X_train)\n",
    "    \n",
    "    \n",
    "    \n",
    "    new_df=df_train[['y','y']].copy()\n",
    "    #new_df.columns=['name', 'popcorn','age','color','y']\n",
    "    new_df[f'$p_{i}$']=probabilities[i]\n",
    "    new_df[f'$l_{i}$']=log_of_odds[i]\n",
    "    new_df[f'$r_{i}$']=residuals[i]\n",
    "    new_df[f'$\\gamma_{i}$']=gamma[i]\n",
    "    new_df[f'$l_{i+1}$']=log_of_odds[i+1]\n",
    "    new_df[f'$p_{i+1}$']=probabilities[i+1]\n",
    "    display(new_df)\n",
    "    \n",
    "    #df_train[f'$\\gamma_{i+1}$']=y_hat.reshape((-1,1))\n",
    "    #df_train[f'$f_{i+1}$']=np.array(prediction[i+1]).reshape((-1,1))\n",
    "    #df_train[f'$r_{i+1}$']=np.array(residuals[i+1]).reshape((-1,1))\n",
    "\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"922pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 922.00 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 918,-384 918,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M513.5,-380C513.5,-380 403.5,-380 403.5,-380 397.5,-380 391.5,-374 391.5,-368 391.5,-368 391.5,-324 391.5,-324 391.5,-318 397.5,-312 403.5,-312 403.5,-312 513.5,-312 513.5,-312 519.5,-312 525.5,-318 525.5,-324 525.5,-324 525.5,-368 525.5,-368 525.5,-374 519.5,-380 513.5,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"458.5\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.525</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M420.5,-276C420.5,-276 318.5,-276 318.5,-276 312.5,-276 306.5,-270 306.5,-264 306.5,-264 306.5,-220 306.5,-220 306.5,-214 312.5,-208 318.5,-208 318.5,-208 420.5,-208 420.5,-208 426.5,-208 432.5,-214 432.5,-220 432.5,-220 432.5,-264 432.5,-264 432.5,-270 426.5,-276 420.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.545</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M429.604,-311.884C421.832,-302.976 413.333,-293.235 405.237,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"407.767,-281.533 398.555,-276.299 402.493,-286.135 407.767,-281.533\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M602.5,-276C602.5,-276 492.5,-276 492.5,-276 486.5,-276 480.5,-270 480.5,-264 480.5,-264 480.5,-220 480.5,-220 480.5,-214 486.5,-208 492.5,-208 492.5,-208 602.5,-208 602.5,-208 608.5,-208 614.5,-214 614.5,-220 614.5,-220 614.5,-264 614.5,-264 614.5,-270 608.5,-276 602.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 16.119</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M487.396,-311.884C495.168,-302.976 503.667,-293.235 511.763,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"514.507,-286.135 518.445,-276.299 509.233,-281.533 514.507,-286.135\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M215.5,-172C215.5,-172 113.5,-172 113.5,-172 107.5,-172 101.5,-166 101.5,-160 101.5,-160 101.5,-116 101.5,-116 101.5,-110 107.5,-104 113.5,-104 113.5,-104 215.5,-104 215.5,-104 221.5,-104 227.5,-110 227.5,-116 227.5,-116 227.5,-160 227.5,-160 227.5,-166 221.5,-172 215.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b3 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.841</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M306.321,-209.564C284.4,-198.658 259.652,-186.344 237.037,-175.091\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"238.336,-171.829 227.824,-170.507 235.218,-178.096 238.336,-171.829\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M420.5,-172C420.5,-172 318.5,-172 318.5,-172 312.5,-172 306.5,-166 306.5,-160 306.5,-160 306.5,-116 306.5,-116 306.5,-110 312.5,-104 318.5,-104 318.5,-104 420.5,-104 420.5,-104 426.5,-104 432.5,-110 432.5,-116 432.5,-116 432.5,-160 432.5,-160 432.5,-166 426.5,-172 420.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 371</text>\r\n",
       "<text text-anchor=\"middle\" x=\"369.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.553</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M369.5,-207.884C369.5,-199.778 369.5,-190.982 369.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"373,-182.299 369.5,-172.299 366,-182.299 373,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 0/1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.400</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127.163,-103.884C116.819,-94.7089 105.478,-84.6503 94.7364,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"96.8471,-72.3165 87.0434,-68.2994 92.2022,-77.5534 96.8471,-72.3165\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.667</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M164.5,-103.884C164.5,-95.7778 164.5,-86.982 164.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"168,-78.2993 164.5,-68.2994 161,-78.2994 168,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M317,-68C317,-68 242,-68 242,-68 236,-68 230,-62 230,-56 230,-56 230,-12 230,-12 230,-6 236,-0 242,-0 242,-0 317,-0 317,-0 323,-0 329,-6 329,-12 329,-12 329,-56 329,-56 329,-62 323,-68 317,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=75</text>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 27/48</text>\r\n",
       "<text text-anchor=\"middle\" x=\"279.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.532</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M340.28,-103.884C332.42,-94.9762 323.825,-85.2354 315.638,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"318.122,-73.4821 308.882,-68.2994 312.874,-78.1135 318.122,-73.4821\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M439.5,-68C439.5,-68 359.5,-68 359.5,-68 353.5,-68 347.5,-62 347.5,-56 347.5,-56 347.5,-12 347.5,-12 347.5,-6 353.5,-0 359.5,-0 359.5,-0 439.5,-0 439.5,-0 445.5,-0 451.5,-6 451.5,-12 451.5,-12 451.5,-56 451.5,-56 451.5,-62 445.5,-68 439.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=296</text>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 68/228</text>\r\n",
       "<text text-anchor=\"middle\" x=\"399.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.067</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M379.24,-103.884C381.677,-95.5997 384.325,-86.5951 386.879,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"390.242,-78.8806 389.706,-68.2994 383.527,-76.9054 390.242,-78.8806\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M598.5,-172C598.5,-172 496.5,-172 496.5,-172 490.5,-172 484.5,-166 484.5,-160 484.5,-160 484.5,-116 484.5,-116 484.5,-110 490.5,-104 496.5,-104 496.5,-104 598.5,-104 598.5,-104 604.5,-104 610.5,-110 610.5,-116 610.5,-116 610.5,-160 610.5,-160 610.5,-166 604.5,-172 598.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.244</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M547.5,-207.884C547.5,-199.778 547.5,-190.982 547.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"551,-182.299 547.5,-172.299 544,-182.299 551,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M804.5,-172C804.5,-172 702.5,-172 702.5,-172 696.5,-172 690.5,-166 690.5,-160 690.5,-160 690.5,-116 690.5,-116 690.5,-110 696.5,-104 702.5,-104 702.5,-104 804.5,-104 804.5,-104 810.5,-104 816.5,-110 816.5,-116 816.5,-116 816.5,-160 816.5,-160 816.5,-166 810.5,-172 804.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.645</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M614.382,-207.884C635.764,-197.296 659.523,-185.532 681.268,-174.765\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"683.043,-177.792 690.451,-170.218 679.936,-171.519 683.043,-177.792\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M553,-68C553,-68 482,-68 482,-68 476,-68 470,-62 470,-56 470,-56 470,-12 470,-12 470,-6 476,-0 482,-0 482,-0 553,-0 553,-0 559,-0 565,-6 565,-12 565,-12 565,-56 565,-56 565,-62 559,-68 553,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=65</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 37/28</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.261</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M537.76,-103.884C535.323,-95.5997 532.675,-86.5951 530.121,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"533.473,-76.9054 527.294,-68.2994 526.758,-78.8806 533.473,-76.9054\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M675.5,-68C675.5,-68 595.5,-68 595.5,-68 589.5,-68 583.5,-62 583.5,-56 583.5,-56 583.5,-12 583.5,-12 583.5,-6 589.5,-0 595.5,-0 595.5,-0 675.5,-0 675.5,-0 681.5,-0 687.5,-6 687.5,-12 687.5,-12 687.5,-56 687.5,-56 687.5,-62 681.5,-68 675.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=150</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 62/88</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.338</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M576.071,-103.884C583.756,-94.9762 592.16,-85.2354 600.165,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"602.889,-78.1573 606.771,-68.2994 597.589,-73.5846 602.889,-78.1573\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M789,-68C789,-68 718,-68 718,-68 712,-68 706,-62 706,-56 706,-56 706,-12 706,-12 706,-6 712,-0 718,-0 718,-0 789,-0 789,-0 795,-0 801,-6 801,-12 801,-12 801,-56 801,-56 801,-62 795,-68 789,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=16</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 10/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.400</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M753.5,-103.884C753.5,-95.7778 753.5,-86.982 753.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"757,-78.2993 753.5,-68.2994 750,-78.2994 757,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M902,-68C902,-68 831,-68 831,-68 825,-68 819,-62 819,-56 819,-56 819,-12 819,-12 819,-6 825,-0 831,-0 831,-0 902,-0 902,-0 908,-0 914,-6 914,-12 914,-12 914,-56 914,-56 914,-62 908,-68 902,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=57</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 44/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.016</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M790.188,-103.884C800.352,-94.7089 811.495,-84.6503 822.05,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"824.532,-77.598 829.61,-68.2994 819.841,-72.4018 824.532,-77.598\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26039eed100>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"474pt\" height=\"284pt\"\r\n",
       " viewBox=\"0.00 0.00 474.00 284.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 280)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-280 470,-280 470,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M287.5,-276C287.5,-276 177.5,-276 177.5,-276 171.5,-276 165.5,-270 165.5,-264 165.5,-264 165.5,-220 165.5,-220 165.5,-214 171.5,-208 177.5,-208 177.5,-208 287.5,-208 287.5,-208 293.5,-208 299.5,-214 299.5,-220 299.5,-220 299.5,-264 299.5,-264 299.5,-270 293.5,-276 287.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"232.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"232.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"232.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"232.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 45.525</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M209.5,-172C209.5,-172 107.5,-172 107.5,-172 101.5,-172 95.5,-166 95.5,-160 95.5,-160 95.5,-116 95.5,-116 95.5,-110 101.5,-104 107.5,-104 107.5,-104 209.5,-104 209.5,-104 215.5,-104 221.5,-110 221.5,-116 221.5,-116 221.5,-160 221.5,-160 221.5,-166 215.5,-172 209.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"158.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"158.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"158.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"158.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.545</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M208.474,-207.884C202.141,-199.154 195.228,-189.625 188.618,-180.514\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"191.364,-178.338 182.658,-172.299 185.698,-182.449 191.364,-178.338\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M361.5,-172C361.5,-172 251.5,-172 251.5,-172 245.5,-172 239.5,-166 239.5,-160 239.5,-160 239.5,-116 239.5,-116 239.5,-110 245.5,-104 251.5,-104 251.5,-104 361.5,-104 361.5,-104 367.5,-104 373.5,-110 373.5,-116 373.5,-116 373.5,-160 373.5,-160 373.5,-166 367.5,-172 361.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"306.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"306.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"306.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"306.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 16.119</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M256.526,-207.884C262.859,-199.154 269.772,-189.625 276.382,-180.514\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"279.302,-182.449 282.342,-172.299 273.636,-178.338 279.302,-182.449\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M83,-68C83,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 83,-0 83,-0 89,-0 95,-6 95,-12 95,-12 95,-56 95,-56 95,-62 89,-68 83,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"47.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.462</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M122.461,-103.884C112.477,-94.7089 101.531,-84.6503 91.163,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"93.469,-72.4885 83.7375,-68.2994 88.7326,-77.6428 93.469,-72.4885\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M205.5,-68C205.5,-68 125.5,-68 125.5,-68 119.5,-68 113.5,-62 113.5,-56 113.5,-56 113.5,-12 113.5,-12 113.5,-6 119.5,-0 125.5,-0 125.5,-0 205.5,-0 205.5,-0 211.5,-0 217.5,-6 217.5,-12 217.5,-12 217.5,-56 217.5,-56 217.5,-62 211.5,-68 205.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=371</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 95/276</text>\r\n",
       "<text text-anchor=\"middle\" x=\"165.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.965</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M160.773,-103.884C161.329,-95.7778 161.933,-86.982 162.517,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"166.022,-78.5156 163.215,-68.2994 159.038,-78.0362 166.022,-78.5156\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M340.5,-68C340.5,-68 260.5,-68 260.5,-68 254.5,-68 248.5,-62 248.5,-56 248.5,-56 248.5,-12 248.5,-12 248.5,-6 254.5,-0 260.5,-0 260.5,-0 340.5,-0 340.5,-0 346.5,-0 352.5,-6 352.5,-12 352.5,-12 352.5,-56 352.5,-56 352.5,-62 346.5,-68 340.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"300.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"300.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"300.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 99/116</text>\r\n",
       "<text text-anchor=\"middle\" x=\"300.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.155</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M304.552,-103.884C304.075,-95.7778 303.558,-86.982 303.057,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"306.54,-78.0765 302.459,-68.2994 299.552,-78.4877 306.54,-78.0765\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M454,-68C454,-68 383,-68 383,-68 377,-68 371,-62 371,-56 371,-56 371,-12 371,-12 371,-6 377,-0 383,-0 383,-0 454,-0 454,-0 460,-0 466,-6 466,-12 466,-12 466,-56 466,-56 466,-62 460,-68 454,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"418.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"418.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"418.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 54/19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"418.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.909</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M342.863,-103.884C352.937,-94.7089 363.982,-84.6503 374.444,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"376.899,-77.6204 381.936,-68.2994 372.186,-72.445 376.899,-77.6204\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055e3d550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y</th>\n",
       "      <th>y</th>\n",
       "      <th>$p_0$</th>\n",
       "      <th>$l_0$</th>\n",
       "      <th>$r_0$</th>\n",
       "      <th>$\\gamma_0$</th>\n",
       "      <th>$l_1$</th>\n",
       "      <th>$p_1$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.155251</td>\n",
       "      <td>-0.046575</td>\n",
       "      <td>0.488358</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.909091</td>\n",
       "      <td>0.272727</td>\n",
       "      <td>0.567762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.155251</td>\n",
       "      <td>-0.046575</td>\n",
       "      <td>0.488358</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.965333</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.428102</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     y  y  $p_0$  $l_0$  $r_0$  $\\gamma_0$     $l_1$     $p_1$\n",
       "0    0  0    0.5    0.0   -0.5   -0.965333 -0.289600  0.428102\n",
       "1    1  1    0.5    0.0    0.5   -0.155251 -0.046575  0.488358\n",
       "2    1  1    0.5    0.0    0.5    0.909091  0.272727  0.567762\n",
       "3    0  0    0.5    0.0   -0.5   -0.965333 -0.289600  0.428102\n",
       "4    0  0    0.5    0.0   -0.5   -0.965333 -0.289600  0.428102\n",
       "..  .. ..    ...    ...    ...         ...       ...       ...\n",
       "663  0  0    0.5    0.0   -0.5   -0.965333 -0.289600  0.428102\n",
       "664  0  0    0.5    0.0   -0.5   -0.155251 -0.046575  0.488358\n",
       "665  0  0    0.5    0.0   -0.5   -0.965333 -0.289600  0.428102\n",
       "666  0  0    0.5    0.0   -0.5   -0.965333 -0.289600  0.428102\n",
       "667  1  1    0.5    0.0    0.5   -0.965333 -0.289600  0.428102\n",
       "\n",
       "[668 rows x 8 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"922pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 922.00 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 918,-384 918,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M514.5,-380C514.5,-380 404.5,-380 404.5,-380 398.5,-380 392.5,-374 392.5,-368 392.5,-368 392.5,-324 392.5,-324 392.5,-318 398.5,-312 404.5,-312 404.5,-312 514.5,-312 514.5,-312 520.5,-312 526.5,-318 526.5,-324 526.5,-324 526.5,-368 526.5,-368 526.5,-374 520.5,-380 514.5,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 23.319</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M422.5,-276C422.5,-276 320.5,-276 320.5,-276 314.5,-276 308.5,-270 308.5,-264 308.5,-264 308.5,-220 308.5,-220 308.5,-214 314.5,-208 320.5,-208 320.5,-208 422.5,-208 422.5,-208 428.5,-208 434.5,-214 434.5,-220 434.5,-220 434.5,-264 434.5,-264 434.5,-270 428.5,-276 422.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.612</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M430.929,-311.884C423.244,-302.976 414.84,-293.235 406.835,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"409.411,-281.585 400.229,-276.299 404.111,-286.157 409.411,-281.585\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M598.5,-276C598.5,-276 496.5,-276 496.5,-276 490.5,-276 484.5,-270 484.5,-264 484.5,-264 484.5,-220 484.5,-220 484.5,-214 490.5,-208 496.5,-208 496.5,-208 598.5,-208 598.5,-208 604.5,-208 610.5,-214 610.5,-220 610.5,-220 610.5,-264 610.5,-264 610.5,-270 604.5,-276 598.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.397</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M488.071,-311.884C495.756,-302.976 504.16,-293.235 512.165,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"514.889,-286.157 518.771,-276.299 509.589,-281.585 514.889,-286.157\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M215.5,-172C215.5,-172 113.5,-172 113.5,-172 107.5,-172 101.5,-166 101.5,-160 101.5,-160 101.5,-116 101.5,-116 101.5,-110 107.5,-104 113.5,-104 113.5,-104 215.5,-104 215.5,-104 221.5,-104 227.5,-110 227.5,-116 227.5,-116 227.5,-160 227.5,-160 227.5,-166 221.5,-172 215.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 77</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 2.157</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M308.268,-209.842C285.701,-198.722 260.108,-186.111 236.834,-174.643\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"238.218,-171.423 227.701,-170.142 235.124,-177.702 238.218,-171.423\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M422.5,-172C422.5,-172 320.5,-172 320.5,-172 314.5,-172 308.5,-166 308.5,-160 308.5,-160 308.5,-116 308.5,-116 308.5,-110 314.5,-104 320.5,-104 320.5,-104 422.5,-104 422.5,-104 428.5,-104 434.5,-110 434.5,-116 434.5,-116 434.5,-160 434.5,-160 434.5,-166 428.5,-172 422.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.715</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M371.5,-207.884C371.5,-199.778 371.5,-190.982 371.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"375,-182.299 371.5,-172.299 368,-182.299 375,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=72</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 25/47</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.313</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127.163,-103.884C116.819,-94.7089 105.478,-84.6503 94.7364,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"96.8471,-72.3165 87.0434,-68.2994 92.2022,-77.5534 96.8471,-72.3165\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 4/1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.738</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M164.5,-103.884C164.5,-95.7778 164.5,-86.982 164.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"168,-78.2993 164.5,-68.2994 161,-78.2994 168,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M322.5,-68C322.5,-68 242.5,-68 242.5,-68 236.5,-68 230.5,-62 230.5,-56 230.5,-56 230.5,-12 230.5,-12 230.5,-6 236.5,-0 242.5,-0 242.5,-0 322.5,-0 322.5,-0 328.5,-0 334.5,-6 334.5,-12 334.5,-12 334.5,-56 334.5,-56 334.5,-62 328.5,-68 322.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=249</text>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 52/197</text>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.881</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M342.604,-103.884C334.832,-94.9762 326.333,-85.2354 318.237,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"320.767,-73.5332 311.555,-68.2994 315.493,-78.1354 320.767,-73.5332\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M440,-68C440,-68 365,-68 365,-68 359,-68 353,-62 353,-56 353,-56 353,-12 353,-12 353,-6 359,-0 365,-0 365,-0 440,-0 440,-0 446,-0 452,-6 452,-12 452,-12 452,-56 452,-56 452,-62 446,-68 440,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=54</text>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 20/34</text>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.271</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M381.565,-103.884C384.082,-95.5997 386.819,-86.5951 389.458,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"392.82,-78.885 392.38,-68.2994 386.123,-76.8495 392.82,-78.885\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M598.5,-172C598.5,-172 496.5,-172 496.5,-172 490.5,-172 484.5,-166 484.5,-160 484.5,-160 484.5,-116 484.5,-116 484.5,-110 490.5,-104 496.5,-104 496.5,-104 598.5,-104 598.5,-104 604.5,-104 610.5,-110 610.5,-116 610.5,-116 610.5,-160 610.5,-160 610.5,-166 604.5,-172 598.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.237</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M547.5,-207.884C547.5,-199.778 547.5,-190.982 547.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"551,-182.299 547.5,-172.299 544,-182.299 551,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M804.5,-172C804.5,-172 702.5,-172 702.5,-172 696.5,-172 690.5,-166 690.5,-160 690.5,-160 690.5,-116 690.5,-116 690.5,-110 696.5,-104 702.5,-104 702.5,-104 804.5,-104 804.5,-104 810.5,-104 816.5,-110 816.5,-116 816.5,-116 816.5,-160 816.5,-160 816.5,-166 810.5,-172 804.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.875</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M610.707,-209.703C633.051,-198.64 658.347,-186.115 681.375,-174.713\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"683.004,-177.811 690.413,-170.237 679.898,-171.538 683.004,-177.811\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M553,-68C553,-68 482,-68 482,-68 476,-68 470,-62 470,-56 470,-56 470,-12 470,-12 470,-6 476,-0 482,-0 482,-0 553,-0 553,-0 559,-0 565,-6 565,-12 565,-12 565,-56 565,-56 565,-62 559,-68 553,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=65</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 37/28</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.305</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M537.76,-103.884C535.323,-95.5997 532.675,-86.5951 530.121,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"533.473,-76.9054 527.294,-68.2994 526.758,-78.8806 533.473,-76.9054\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M675.5,-68C675.5,-68 595.5,-68 595.5,-68 589.5,-68 583.5,-62 583.5,-56 583.5,-56 583.5,-12 583.5,-12 583.5,-6 589.5,-0 595.5,-0 595.5,-0 675.5,-0 675.5,-0 681.5,-0 687.5,-6 687.5,-12 687.5,-12 687.5,-56 687.5,-56 687.5,-62 681.5,-68 675.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=150</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 62/88</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.292</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M576.071,-103.884C583.756,-94.9762 592.16,-85.2354 600.165,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"602.889,-78.1573 606.771,-68.2994 597.589,-73.5846 602.889,-78.1573\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M789,-68C789,-68 718,-68 718,-68 712,-68 706,-62 706,-56 706,-56 706,-12 706,-12 706,-6 712,-0 718,-0 718,-0 789,-0 789,-0 795,-0 801,-6 801,-12 801,-12 801,-56 801,-56 801,-62 795,-68 789,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=16</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 10/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.186</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M753.5,-103.884C753.5,-95.7778 753.5,-86.982 753.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"757,-78.2993 753.5,-68.2994 750,-78.2994 757,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M902,-68C902,-68 831,-68 831,-68 825,-68 819,-62 819,-56 819,-56 819,-12 819,-12 819,-6 825,-0 831,-0 831,-0 902,-0 902,-0 908,-0 914,-6 914,-12 914,-12 914,-56 914,-56 914,-62 908,-68 902,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=57</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 44/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.776</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M790.188,-103.884C800.352,-94.7089 811.495,-84.6503 822.05,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"824.532,-77.598 829.61,-68.2994 819.841,-72.4018 824.532,-77.598\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055fe4340>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"300pt\" height=\"284pt\"\r\n",
       " viewBox=\"0.00 0.00 299.50 284.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 280)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-280 295.5,-280 295.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M173,-276C173,-276 63,-276 63,-276 57,-276 51,-270 51,-264 51,-264 51,-220 51,-220 51,-214 57,-208 63,-208 63,-208 173,-208 173,-208 179,-208 185,-214 185,-220 185,-220 185,-264 185,-264 185,-270 179,-276 173,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 23.319</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-172C92,-172 12,-172 12,-172 6,-172 0,-166 0,-160 0,-160 0,-116 0,-116 0,-110 6,-104 12,-104 12,-104 92,-104 92,-104 98,-104 104,-110 104,-116 104,-116 104,-160 104,-160 104,-166 98,-172 92,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 101/279</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.666</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M96.5717,-207.884C90.981,-199.243 84.883,-189.819 79.0424,-180.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"81.9177,-178.794 73.5466,-172.299 76.0407,-182.596 81.9177,-178.794\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M236,-172C236,-172 134,-172 134,-172 128,-172 122,-166 122,-160 122,-160 122,-116 122,-116 122,-110 128,-104 134,-104 134,-104 236,-104 236,-104 242,-104 248,-110 248,-116 248,-116 248,-160 248,-160 248,-166 242,-172 236,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.397</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M139.753,-207.884C145.428,-199.243 151.619,-189.819 157.548,-180.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"160.562,-182.579 163.127,-172.299 154.711,-178.736 160.562,-182.579\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M166,-68C166,-68 86,-68 86,-68 80,-68 74,-62 74,-56 74,-56 74,-12 74,-12 74,-6 80,-0 86,-0 86,-0 166,-0 166,-0 172,-0 178,-6 178,-12 178,-12 178,-56 178,-56 178,-62 172,-68 166,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"126\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"126\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"126\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 99/116</text>\r\n",
       "<text text-anchor=\"middle\" x=\"126\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.110</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M165.844,-103.884C160.898,-95.3324 155.508,-86.0134 150.336,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"153.298,-75.2031 145.261,-68.2994 147.239,-78.708 153.298,-75.2031\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M279.5,-68C279.5,-68 208.5,-68 208.5,-68 202.5,-68 196.5,-62 196.5,-56 196.5,-56 196.5,-12 196.5,-12 196.5,-6 202.5,-0 208.5,-0 208.5,-0 279.5,-0 279.5,-0 285.5,-0 291.5,-6 291.5,-12 291.5,-12 291.5,-56 291.5,-56 291.5,-62 285.5,-68 279.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 54/19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.664</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M204.156,-103.884C209.102,-95.3324 214.492,-86.0134 219.664,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"222.761,-78.708 224.739,-68.2994 216.702,-75.2031 222.761,-78.708\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055e3d550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y</th>\n",
       "      <th>y</th>\n",
       "      <th>$p_1$</th>\n",
       "      <th>$l_1$</th>\n",
       "      <th>$r_1$</th>\n",
       "      <th>$\\gamma_1$</th>\n",
       "      <th>$l_2$</th>\n",
       "      <th>$p_2$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>-0.428102</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.488358</td>\n",
       "      <td>-0.046575</td>\n",
       "      <td>0.511642</td>\n",
       "      <td>-0.109593</td>\n",
       "      <td>-0.079453</td>\n",
       "      <td>0.480147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.567762</td>\n",
       "      <td>0.272727</td>\n",
       "      <td>0.432238</td>\n",
       "      <td>0.663679</td>\n",
       "      <td>0.471831</td>\n",
       "      <td>0.615817</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>-0.428102</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>-0.428102</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>-0.428102</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.488358</td>\n",
       "      <td>-0.046575</td>\n",
       "      <td>-0.488358</td>\n",
       "      <td>-0.109593</td>\n",
       "      <td>-0.079453</td>\n",
       "      <td>0.480147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>-0.428102</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>-0.428102</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.428102</td>\n",
       "      <td>-0.289600</td>\n",
       "      <td>0.571898</td>\n",
       "      <td>-0.665843</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.380046</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     y  y     $p_1$     $l_1$     $r_1$  $\\gamma_1$     $l_2$     $p_2$\n",
       "0    0  0  0.428102 -0.289600 -0.428102   -0.665843 -0.489353  0.380046\n",
       "1    1  1  0.488358 -0.046575  0.511642   -0.109593 -0.079453  0.480147\n",
       "2    1  1  0.567762  0.272727  0.432238    0.663679  0.471831  0.615817\n",
       "3    0  0  0.428102 -0.289600 -0.428102   -0.665843 -0.489353  0.380046\n",
       "4    0  0  0.428102 -0.289600 -0.428102   -0.665843 -0.489353  0.380046\n",
       "..  .. ..       ...       ...       ...         ...       ...       ...\n",
       "663  0  0  0.428102 -0.289600 -0.428102   -0.665843 -0.489353  0.380046\n",
       "664  0  0  0.488358 -0.046575 -0.488358   -0.109593 -0.079453  0.480147\n",
       "665  0  0  0.428102 -0.289600 -0.428102   -0.665843 -0.489353  0.380046\n",
       "666  0  0  0.428102 -0.289600 -0.428102   -0.665843 -0.489353  0.380046\n",
       "667  1  1  0.428102 -0.289600  0.571898   -0.665843 -0.489353  0.380046\n",
       "\n",
       "[668 rows x 8 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In iteration 1, we firstly train a tree using residuals_1. This tree tells us height is also important in determining weight. Whose who are less than 1.55 meters are supported to lose -7.289 and the other to gain 7.289. Again, we want to shrink this to 20%, which is -1.4578 and 1.4578. We then make prediction_2 based on prediction_1 and $\\gamma$. We see Alex gains 1.4578 kg because he is 1.6. Others also gain or lose weight because of the new rule."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"922pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 922.00 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 918,-384 918,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M514.5,-380C514.5,-380 404.5,-380 404.5,-380 398.5,-380 392.5,-374 392.5,-368 392.5,-368 392.5,-324 392.5,-324 392.5,-318 398.5,-312 404.5,-312 404.5,-312 514.5,-312 514.5,-312 520.5,-312 526.5,-318 526.5,-324 526.5,-324 526.5,-368 526.5,-368 526.5,-374 520.5,-380 514.5,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"459.5\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 12.349</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M422.5,-276C422.5,-276 320.5,-276 320.5,-276 314.5,-276 308.5,-270 308.5,-264 308.5,-264 308.5,-220 308.5,-220 308.5,-214 314.5,-208 320.5,-208 320.5,-208 422.5,-208 422.5,-208 428.5,-208 434.5,-214 434.5,-220 434.5,-220 434.5,-264 434.5,-264 434.5,-270 428.5,-276 422.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.877</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M430.929,-311.884C423.244,-302.976 414.84,-293.235 406.835,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"409.411,-281.585 400.229,-276.299 404.111,-286.157 409.411,-281.585\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M598.5,-276C598.5,-276 496.5,-276 496.5,-276 490.5,-276 484.5,-270 484.5,-264 484.5,-264 484.5,-220 484.5,-220 484.5,-214 490.5,-208 496.5,-208 496.5,-208 598.5,-208 598.5,-208 604.5,-208 610.5,-214 610.5,-220 610.5,-220 610.5,-264 610.5,-264 610.5,-270 604.5,-276 598.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.484</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M488.071,-311.884C495.756,-302.976 504.16,-293.235 512.165,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"514.889,-286.157 518.771,-276.299 509.589,-281.585 514.889,-286.157\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M215.5,-172C215.5,-172 113.5,-172 113.5,-172 107.5,-172 101.5,-166 101.5,-160 101.5,-160 101.5,-116 101.5,-116 101.5,-110 107.5,-104 113.5,-104 113.5,-104 215.5,-104 215.5,-104 221.5,-104 227.5,-110 227.5,-116 227.5,-116 227.5,-160 227.5,-160 227.5,-166 221.5,-172 215.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 77</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.919</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M308.268,-209.842C285.701,-198.722 260.108,-186.111 236.834,-174.643\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"238.218,-171.423 227.701,-170.142 235.124,-177.702 238.218,-171.423\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M422.5,-172C422.5,-172 320.5,-172 320.5,-172 314.5,-172 308.5,-166 308.5,-160 308.5,-160 308.5,-116 308.5,-116 308.5,-110 314.5,-104 320.5,-104 320.5,-104 422.5,-104 422.5,-104 428.5,-104 434.5,-110 434.5,-116 434.5,-116 434.5,-160 434.5,-160 434.5,-166 428.5,-172 422.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 303</text>\r\n",
       "<text text-anchor=\"middle\" x=\"371.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.004</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M371.5,-207.884C371.5,-199.778 371.5,-190.982 371.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"375,-182.299 371.5,-172.299 368,-182.299 375,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=72</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 25/47</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.132</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127.163,-103.884C116.819,-94.7089 105.478,-84.6503 94.7364,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"96.8471,-72.3165 87.0434,-68.2994 92.2022,-77.5534 96.8471,-72.3165\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 4/1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.857</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M164.5,-103.884C164.5,-95.7778 164.5,-86.982 164.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"168,-78.2993 164.5,-68.2994 161,-78.2994 168,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M322.5,-68C322.5,-68 242.5,-68 242.5,-68 236.5,-68 230.5,-62 230.5,-56 230.5,-56 230.5,-12 230.5,-12 230.5,-6 236.5,-0 242.5,-0 242.5,-0 322.5,-0 322.5,-0 328.5,-0 334.5,-6 334.5,-12 334.5,-12 334.5,-56 334.5,-56 334.5,-62 328.5,-68 322.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=249</text>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 52/197</text>\r\n",
       "<text text-anchor=\"middle\" x=\"282.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.714</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M342.604,-103.884C334.832,-94.9762 326.333,-85.2354 318.237,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"320.767,-73.5332 311.555,-68.2994 315.493,-78.1354 320.767,-73.5332\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M440,-68C440,-68 365,-68 365,-68 359,-68 353,-62 353,-56 353,-56 353,-12 353,-12 353,-6 359,-0 365,-0 365,-0 440,-0 440,-0 446,-0 452,-6 452,-12 452,-12 452,-56 452,-56 452,-62 446,-68 440,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=54</text>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 20/34</text>\r\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.091</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M381.565,-103.884C384.082,-95.5997 386.819,-86.5951 389.458,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"392.82,-78.885 392.38,-68.2994 386.123,-76.8495 392.82,-78.885\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M598.5,-172C598.5,-172 496.5,-172 496.5,-172 490.5,-172 484.5,-166 484.5,-160 484.5,-160 484.5,-116 484.5,-116 484.5,-110 490.5,-104 496.5,-104 496.5,-104 598.5,-104 598.5,-104 604.5,-104 610.5,-110 610.5,-116 610.5,-116 610.5,-160 610.5,-160 610.5,-166 604.5,-172 598.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 215</text>\r\n",
       "<text text-anchor=\"middle\" x=\"547.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 4.232</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M547.5,-207.884C547.5,-199.778 547.5,-190.982 547.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"551,-182.299 547.5,-172.299 544,-182.299 551,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M804.5,-172C804.5,-172 702.5,-172 702.5,-172 696.5,-172 690.5,-166 690.5,-160 690.5,-160 690.5,-116 690.5,-116 690.5,-110 696.5,-104 702.5,-104 702.5,-104 804.5,-104 804.5,-104 810.5,-104 816.5,-110 816.5,-116 816.5,-116 816.5,-160 816.5,-160 816.5,-166 810.5,-172 804.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.993</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M610.707,-209.703C633.051,-198.64 658.347,-186.115 681.375,-174.713\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"683.004,-177.811 690.413,-170.237 679.898,-171.538 683.004,-177.811\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M553,-68C553,-68 482,-68 482,-68 476,-68 470,-62 470,-56 470,-56 470,-12 470,-12 470,-6 476,-0 482,-0 482,-0 553,-0 553,-0 559,-0 565,-6 565,-12 565,-12 565,-56 565,-56 565,-62 559,-68 553,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=65</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 37/28</text>\r\n",
       "<text text-anchor=\"middle\" x=\"517.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.336</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M537.76,-103.884C535.323,-95.5997 532.675,-86.5951 530.121,-77.9115\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"533.473,-76.9054 527.294,-68.2994 526.758,-78.8806 533.473,-76.9054\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M675.5,-68C675.5,-68 595.5,-68 595.5,-68 589.5,-68 583.5,-62 583.5,-56 583.5,-56 583.5,-12 583.5,-12 583.5,-6 589.5,-0 595.5,-0 595.5,-0 675.5,-0 675.5,-0 681.5,-0 687.5,-6 687.5,-12 687.5,-12 687.5,-56 687.5,-56 687.5,-62 681.5,-68 675.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=150</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 62/88</text>\r\n",
       "<text text-anchor=\"middle\" x=\"635.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.261</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M576.071,-103.884C583.756,-94.9762 592.16,-85.2354 600.165,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"602.889,-78.1573 606.771,-68.2994 597.589,-73.5846 602.889,-78.1573\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M789,-68C789,-68 718,-68 718,-68 712,-68 706,-62 706,-56 706,-56 706,-12 706,-12 706,-6 712,-0 718,-0 718,-0 789,-0 789,-0 795,-0 801,-6 801,-12 801,-12 801,-56 801,-56 801,-62 795,-68 789,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=16</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 10/6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"753.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.031</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M753.5,-103.884C753.5,-95.7778 753.5,-86.982 753.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"757,-78.2993 753.5,-68.2994 750,-78.2994 757,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M902,-68C902,-68 831,-68 831,-68 825,-68 819,-62 819,-56 819,-56 819,-12 819,-12 819,-6 825,-0 831,-0 831,-0 902,-0 902,-0 908,-0 914,-6 914,-12 914,-12 914,-56 914,-56 914,-62 908,-68 902,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=57</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 44/13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"866.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.614</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M790.188,-103.884C800.352,-94.7089 811.495,-84.6503 822.05,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"824.532,-77.598 829.61,-68.2994 819.841,-72.4018 824.532,-77.598\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055fe4430>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"234pt\" height=\"180pt\"\r\n",
       " viewBox=\"0.00 0.00 234.00 180.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 176)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-176 230,-176 230,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M168,-172C168,-172 58,-172 58,-172 52,-172 46,-166 46,-160 46,-160 46,-116 46,-116 46,-110 52,-104 58,-104 58,-104 168,-104 168,-104 174,-104 180,-110 180,-116 180,-116 180,-160 180,-160 180,-166 174,-172 168,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"113\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"113\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"113\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"113\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 12.349</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=380</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 101/279</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.489</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M93.195,-103.884C88.0812,-95.3324 82.508,-86.0134 77.1608,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"80.0508,-75.0853 71.9143,-68.2994 74.0431,-78.6781 80.0508,-75.0853\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M214,-68C214,-68 134,-68 134,-68 128,-68 122,-62 122,-56 122,-56 122,-12 122,-12 122,-6 128,-0 134,-0 134,-0 214,-0 214,-0 220,-0 226,-6 226,-12 226,-12 226,-56 226,-56 226,-62 220,-68 214,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=288</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 153/135</text>\r\n",
       "<text text-anchor=\"middle\" x=\"174\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.067</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M132.805,-103.884C137.919,-95.3324 143.492,-86.0134 148.839,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"151.957,-78.6781 154.086,-68.2994 145.949,-75.0853 151.957,-78.6781\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055fe4340>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y</th>\n",
       "      <th>y</th>\n",
       "      <th>$p_2$</th>\n",
       "      <th>$l_2$</th>\n",
       "      <th>$r_2$</th>\n",
       "      <th>$\\gamma_2$</th>\n",
       "      <th>$l_3$</th>\n",
       "      <th>$p_3$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>-0.380046</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.480147</td>\n",
       "      <td>-0.079453</td>\n",
       "      <td>0.519853</td>\n",
       "      <td>0.066917</td>\n",
       "      <td>-0.059378</td>\n",
       "      <td>0.485160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.615817</td>\n",
       "      <td>0.471831</td>\n",
       "      <td>0.384183</td>\n",
       "      <td>0.066917</td>\n",
       "      <td>0.491906</td>\n",
       "      <td>0.620555</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>-0.380046</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>-0.380046</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>-0.380046</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.480147</td>\n",
       "      <td>-0.079453</td>\n",
       "      <td>-0.480147</td>\n",
       "      <td>0.066917</td>\n",
       "      <td>-0.059378</td>\n",
       "      <td>0.485160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>-0.380046</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>-0.380046</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.380046</td>\n",
       "      <td>-0.489353</td>\n",
       "      <td>0.619954</td>\n",
       "      <td>-0.489294</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.346119</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     y  y     $p_2$     $l_2$     $r_2$  $\\gamma_2$     $l_3$     $p_3$\n",
       "0    0  0  0.380046 -0.489353 -0.380046   -0.489294 -0.636141  0.346119\n",
       "1    1  1  0.480147 -0.079453  0.519853    0.066917 -0.059378  0.485160\n",
       "2    1  1  0.615817  0.471831  0.384183    0.066917  0.491906  0.620555\n",
       "3    0  0  0.380046 -0.489353 -0.380046   -0.489294 -0.636141  0.346119\n",
       "4    0  0  0.380046 -0.489353 -0.380046   -0.489294 -0.636141  0.346119\n",
       "..  .. ..       ...       ...       ...         ...       ...       ...\n",
       "663  0  0  0.380046 -0.489353 -0.380046   -0.489294 -0.636141  0.346119\n",
       "664  0  0  0.480147 -0.079453 -0.480147    0.066917 -0.059378  0.485160\n",
       "665  0  0  0.380046 -0.489353 -0.380046   -0.489294 -0.636141  0.346119\n",
       "666  0  0  0.380046 -0.489353 -0.380046   -0.489294 -0.636141  0.346119\n",
       "667  1  1  0.380046 -0.489353  0.619954   -0.489294 -0.636141  0.346119\n",
       "\n",
       "[668 rows x 8 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Iteration 2 again tells us that gender matters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"918pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 917.50 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 913.5,-384 913.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M511,-380C511,-380 409,-380 409,-380 403,-380 397,-374 397,-368 397,-368 397,-324 397,-324 397,-318 403,-312 409,-312 409,-312 511,-312 511,-312 517,-312 523,-318 523,-324 523,-324 523,-368 523,-368 523,-374 517,-380 511,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"460\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"460\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"460\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"460\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.770</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M427,-276C427,-276 317,-276 317,-276 311,-276 305,-270 305,-264 305,-264 305,-220 305,-220 305,-214 311,-208 317,-208 317,-208 427,-208 427,-208 433,-208 439,-214 439,-220 439,-220 439,-264 439,-264 439,-270 433,-276 427,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 595</text>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.441</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M431.429,-311.884C423.744,-302.976 415.34,-293.235 407.335,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"409.911,-281.585 400.729,-276.299 404.611,-286.157 409.911,-281.585\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M599,-276C599,-276 497,-276 497,-276 491,-276 485,-270 485,-264 485,-264 485,-220 485,-220 485,-214 491,-208 497,-208 497,-208 599,-208 599,-208 605,-208 611,-214 611,-220 611,-220 611,-264 611,-264 611,-270 605,-276 599,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b2 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.003</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M488.571,-311.884C496.256,-302.976 504.66,-293.235 512.665,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"515.389,-286.157 519.271,-276.299 510.089,-281.585 515.389,-286.157\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M221,-172C221,-172 119,-172 119,-172 113,-172 107,-166 107,-160 107,-160 107,-116 107,-116 107,-110 113,-104 119,-104 119,-104 221,-104 221,-104 227,-104 233,-110 233,-116 233,-116 233,-160 233,-160 233,-166 227,-172 221,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 142</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.331</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M306.416,-207.884C285.945,-197.546 263.251,-186.087 242.343,-175.53\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"243.695,-172.292 233.191,-170.908 240.54,-178.54 243.695,-172.292\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M423,-172C423,-172 321,-172 321,-172 315,-172 309,-166 309,-160 309,-160 309,-116 309,-116 309,-110 315,-104 321,-104 321,-104 423,-104 423,-104 429,-104 435,-110 435,-116 435,-116 435,-160 435,-160 435,-166 429,-172 423,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b0 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 453</text>\r\n",
       "<text text-anchor=\"middle\" x=\"372\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.501</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M372,-207.884C372,-199.778 372,-190.982 372,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"375.5,-182.299 372,-172.299 368.5,-182.299 375.5,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=123</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 51/72</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.044</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M131.689,-103.884C120.972,-94.6199 109.212,-84.4549 98.0957,-74.8454\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"100.377,-72.1911 90.5228,-68.2994 95.7993,-77.4868 100.377,-72.1911\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M205.5,-68C205.5,-68 134.5,-68 134.5,-68 128.5,-68 122.5,-62 122.5,-56 122.5,-56 122.5,-12 122.5,-12 122.5,-6 128.5,-0 134.5,-0 134.5,-0 205.5,-0 205.5,-0 211.5,-0 217.5,-6 217.5,-12 217.5,-12 217.5,-56 217.5,-56 217.5,-62 211.5,-68 205.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 15/4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.106</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M170,-103.884C170,-95.7778 170,-86.982 170,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"173.5,-78.2993 170,-68.2994 166.5,-78.2994 173.5,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M318.5,-68C318.5,-68 247.5,-68 247.5,-68 241.5,-68 235.5,-62 235.5,-56 235.5,-56 235.5,-12 235.5,-12 235.5,-6 241.5,-0 247.5,-0 247.5,-0 318.5,-0 318.5,-0 324.5,-0 330.5,-6 330.5,-12 330.5,-12 330.5,-56 330.5,-56 330.5,-62 324.5,-68 318.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"283\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=72</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 29/43</text>\r\n",
       "<text text-anchor=\"middle\" x=\"283\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.003</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M343.104,-103.884C335.332,-94.9762 326.833,-85.2354 318.737,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"321.267,-73.5332 312.055,-68.2994 315.993,-78.1354 321.267,-73.5332\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M441,-68C441,-68 361,-68 361,-68 355,-68 349,-62 349,-56 349,-56 349,-12 349,-12 349,-6 355,-0 361,-0 361,-0 441,-0 441,-0 447,-0 453,-6 453,-12 453,-12 453,-56 453,-56 453,-62 447,-68 441,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"401\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"401\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=381</text>\r\n",
       "<text text-anchor=\"middle\" x=\"401\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 105/276</text>\r\n",
       "<text text-anchor=\"middle\" x=\"401\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.492</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M381.415,-103.884C383.745,-95.6887 386.276,-86.7886 388.72,-78.1917\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"392.164,-78.8753 391.533,-68.2994 385.431,-76.961 392.164,-78.8753\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M599,-172C599,-172 497,-172 497,-172 491,-172 485,-166 485,-160 485,-160 485,-116 485,-116 485,-110 491,-104 497,-104 497,-104 599,-104 599,-104 605,-104 611,-110 611,-116 611,-116 611,-160 611,-160 611,-166 605,-172 599,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 16</text>\r\n",
       "<text text-anchor=\"middle\" x=\"548\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.840</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M548,-207.884C548,-199.778 548,-190.982 548,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"551.5,-182.299 548,-172.299 544.5,-182.299 551.5,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M800,-172C800,-172 698,-172 698,-172 692,-172 686,-166 686,-160 686,-160 686,-116 686,-116 686,-110 692,-104 698,-104 698,-104 800,-104 800,-104 806,-104 812,-110 812,-116 812,-116 812,-160 812,-160 812,-166 806,-172 800,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 57</text>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 0.264</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M611.046,-209.006C631.899,-198.424 655.263,-186.568 676.751,-175.664\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"678.499,-178.702 685.832,-171.055 675.331,-172.46 678.499,-178.702\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M554.5,-68C554.5,-68 483.5,-68 483.5,-68 477.5,-68 471.5,-62 471.5,-56 471.5,-56 471.5,-12 471.5,-12 471.5,-6 477.5,-0 483.5,-0 483.5,-0 554.5,-0 554.5,-0 560.5,-0 566.5,-6 566.5,-12 566.5,-12 566.5,-56 566.5,-56 566.5,-62 560.5,-68 554.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"519\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"519\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"519\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"519\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.625</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M538.585,-103.884C536.255,-95.6887 533.724,-86.7886 531.28,-78.1917\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"534.569,-76.961 528.467,-68.2994 527.836,-78.8753 534.569,-76.961\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M671.5,-68C671.5,-68 596.5,-68 596.5,-68 590.5,-68 584.5,-62 584.5,-56 584.5,-56 584.5,-12 584.5,-12 584.5,-6 590.5,-0 596.5,-0 596.5,-0 671.5,-0 671.5,-0 677.5,-0 683.5,-6 683.5,-12 683.5,-12 683.5,-56 683.5,-56 683.5,-62 677.5,-68 671.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"634\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"634\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"634\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 4/5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"634\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.508</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M575.922,-103.884C583.432,-94.9762 591.645,-85.2354 599.468,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"602.154,-78.2007 605.924,-68.2994 596.802,-73.6885 602.154,-78.2007\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M784.5,-68C784.5,-68 713.5,-68 713.5,-68 707.5,-68 701.5,-62 701.5,-56 701.5,-56 701.5,-12 701.5,-12 701.5,-6 707.5,-0 713.5,-0 713.5,-0 784.5,-0 784.5,-0 790.5,-0 796.5,-6 796.5,-12 796.5,-12 796.5,-56 796.5,-56 796.5,-62 790.5,-68 784.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=41</text>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 30/11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"749\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.428</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M749,-103.884C749,-95.7778 749,-86.982 749,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"752.5,-78.2993 749,-68.2994 745.5,-78.2994 752.5,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M897.5,-68C897.5,-68 826.5,-68 826.5,-68 820.5,-68 814.5,-62 814.5,-56 814.5,-56 814.5,-12 814.5,-12 814.5,-6 820.5,-0 826.5,-0 826.5,-0 897.5,-0 897.5,-0 903.5,-0 909.5,-6 909.5,-12 909.5,-12 909.5,-56 909.5,-56 909.5,-62 903.5,-68 897.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"862\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=16</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 14/2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"862\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.854</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M785.688,-103.884C795.852,-94.7089 806.995,-84.6503 817.55,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"820.032,-77.598 825.11,-68.2994 815.341,-72.4018 820.032,-77.598\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x26055fe4310>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"366pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 365.50 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 361.5,-384 361.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M294,-380C294,-380 192,-380 192,-380 186,-380 180,-374 180,-368 180,-368 180,-324 180,-324 180,-318 186,-312 192,-312 192,-312 294,-312 294,-312 300,-312 306,-318 306,-324 306,-324 306,-368 306,-368 306,-374 300,-380 294,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"243\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"243\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"243\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"243\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.770</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M232,-276C232,-276 122,-276 122,-276 116,-276 110,-270 110,-264 110,-264 110,-220 110,-220 110,-214 116,-208 122,-208 122,-208 232,-208 232,-208 238,-208 244,-214 244,-220 244,-220 244,-264 244,-264 244,-270 238,-276 232,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"177\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"177\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"177\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 595</text>\r\n",
       "<text text-anchor=\"middle\" x=\"177\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 10.441</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M221.572,-311.884C215.981,-303.243 209.883,-293.819 204.042,-284.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"206.918,-282.794 198.547,-276.299 201.041,-286.596 206.918,-282.794\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M345.5,-276C345.5,-276 274.5,-276 274.5,-276 268.5,-276 262.5,-270 262.5,-264 262.5,-264 262.5,-220 262.5,-220 262.5,-214 268.5,-208 274.5,-208 274.5,-208 345.5,-208 345.5,-208 351.5,-208 357.5,-214 357.5,-220 357.5,-220 357.5,-264 357.5,-264 357.5,-270 351.5,-276 345.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"310\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"310\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=73</text>\r\n",
       "<text text-anchor=\"middle\" x=\"310\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 54/19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"310\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.478</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M264.753,-311.884C270.428,-303.243 276.619,-293.819 282.548,-284.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"285.562,-286.579 288.127,-276.299 279.711,-282.736 285.562,-286.579\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M162,-172C162,-172 60,-172 60,-172 54,-172 48,-166 48,-160 48,-160 48,-116 48,-116 48,-110 54,-104 60,-104 60,-104 162,-104 162,-104 168,-104 174,-110 174,-116 174,-116 174,-160 174,-160 174,-166 168,-172 162,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 142</text>\r\n",
       "<text text-anchor=\"middle\" x=\"111\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 5.331</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M155.572,-207.884C149.981,-199.243 143.883,-189.819 138.042,-180.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"140.918,-178.794 132.547,-172.299 135.041,-182.596 140.918,-178.794\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M284,-172C284,-172 204,-172 204,-172 198,-172 192,-166 192,-160 192,-160 192,-116 192,-116 192,-110 198,-104 204,-104 204,-104 284,-104 284,-104 290,-104 296,-110 296,-116 296,-116 296,-160 296,-160 296,-166 290,-172 284,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=453</text>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 134/319</text>\r\n",
       "<text text-anchor=\"middle\" x=\"244\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.414</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M198.753,-207.884C204.428,-199.243 210.619,-189.819 216.548,-180.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"219.562,-182.579 222.127,-172.299 213.711,-178.736 219.562,-182.579\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-68C92,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 92,-0 92,-0 98,-0 104,-6 104,-12 104,-12 104,-56 104,-56 104,-62 98,-68 92,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=123</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 51/72</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.044</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M91.8444,-103.884C86.8982,-95.3324 81.5077,-86.0134 76.3359,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"79.2981,-75.2031 71.2614,-68.2994 73.2388,-78.708 79.2981,-75.2031\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M205.5,-68C205.5,-68 134.5,-68 134.5,-68 128.5,-68 122.5,-62 122.5,-56 122.5,-56 122.5,-12 122.5,-12 122.5,-6 128.5,-0 134.5,-0 134.5,-0 205.5,-0 205.5,-0 211.5,-0 217.5,-6 217.5,-12 217.5,-12 217.5,-56 217.5,-56 217.5,-62 211.5,-68 205.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=19</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 15/4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"170\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=1.106</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M130.156,-103.884C135.102,-95.3324 140.492,-86.0134 145.664,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"148.761,-78.708 150.739,-68.2994 142.702,-75.2031 148.761,-78.708\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2605613e3d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y</th>\n",
       "      <th>y</th>\n",
       "      <th>$p_3$</th>\n",
       "      <th>$l_3$</th>\n",
       "      <th>$r_3$</th>\n",
       "      <th>$\\gamma_3$</th>\n",
       "      <th>$l_4$</th>\n",
       "      <th>$p_4$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>-0.346119</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.485160</td>\n",
       "      <td>-0.059378</td>\n",
       "      <td>0.514840</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.183540</td>\n",
       "      <td>0.454243</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.620555</td>\n",
       "      <td>0.491906</td>\n",
       "      <td>0.379445</td>\n",
       "      <td>0.478280</td>\n",
       "      <td>0.635390</td>\n",
       "      <td>0.653711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>-0.346119</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>-0.346119</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>-0.346119</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.485160</td>\n",
       "      <td>-0.059378</td>\n",
       "      <td>-0.485160</td>\n",
       "      <td>0.044492</td>\n",
       "      <td>-0.046031</td>\n",
       "      <td>0.488494</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>-0.346119</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>-0.346119</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.346119</td>\n",
       "      <td>-0.636141</td>\n",
       "      <td>0.653881</td>\n",
       "      <td>-0.413871</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.318581</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     y  y     $p_3$     $l_3$     $r_3$  $\\gamma_3$     $l_4$     $p_4$\n",
       "0    0  0  0.346119 -0.636141 -0.346119   -0.413871 -0.760303  0.318581\n",
       "1    1  1  0.485160 -0.059378  0.514840   -0.413871 -0.183540  0.454243\n",
       "2    1  1  0.620555  0.491906  0.379445    0.478280  0.635390  0.653711\n",
       "3    0  0  0.346119 -0.636141 -0.346119   -0.413871 -0.760303  0.318581\n",
       "4    0  0  0.346119 -0.636141 -0.346119   -0.413871 -0.760303  0.318581\n",
       "..  .. ..       ...       ...       ...         ...       ...       ...\n",
       "663  0  0  0.346119 -0.636141 -0.346119   -0.413871 -0.760303  0.318581\n",
       "664  0  0  0.485160 -0.059378 -0.485160    0.044492 -0.046031  0.488494\n",
       "665  0  0  0.346119 -0.636141 -0.346119   -0.413871 -0.760303  0.318581\n",
       "666  0  0  0.346119 -0.636141 -0.346119   -0.413871 -0.760303  0.318581\n",
       "667  1  1  0.346119 -0.636141  0.653881   -0.413871 -0.760303  0.318581\n",
       "\n",
       "[668 rows x 8 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Iteration 3 argues that height is important, too."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"925pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 924.50 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 920.5,-384 920.5,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M500.5,-380C500.5,-380 398.5,-380 398.5,-380 392.5,-380 386.5,-374 386.5,-368 386.5,-368 386.5,-324 386.5,-324 386.5,-318 392.5,-312 398.5,-312 398.5,-312 500.5,-312 500.5,-312 506.5,-312 512.5,-318 512.5,-324 512.5,-324 512.5,-368 512.5,-368 512.5,-374 506.5,-380 500.5,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b0 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"449.5\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 6.095</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M415.5,-276C415.5,-276 313.5,-276 313.5,-276 307.5,-276 301.5,-270 301.5,-264 301.5,-264 301.5,-220 301.5,-220 301.5,-214 307.5,-208 313.5,-208 313.5,-208 415.5,-208 415.5,-208 421.5,-208 427.5,-214 427.5,-220 427.5,-220 427.5,-264 427.5,-264 427.5,-270 421.5,-276 415.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 146</text>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.382</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M421.903,-311.884C414.554,-303.065 406.525,-293.43 398.863,-284.235\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"401.34,-281.741 392.249,-276.299 395.963,-286.222 401.34,-281.741\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node9\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M586.5,-276C586.5,-276 484.5,-276 484.5,-276 478.5,-276 472.5,-270 472.5,-264 472.5,-264 472.5,-220 472.5,-220 472.5,-214 478.5,-208 484.5,-208 484.5,-208 586.5,-208 586.5,-208 592.5,-208 598.5,-214 598.5,-220 598.5,-220 598.5,-264 598.5,-264 598.5,-270 592.5,-276 586.5,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b0 &lt;= 11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 522</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.371</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge8\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M477.422,-311.884C484.932,-302.976 493.145,-293.235 500.968,-283.957\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"503.654,-286.201 507.424,-276.299 498.302,-281.689 503.654,-286.201\"/>\r\n",
       "</g>\r\n",
       "<!-- 2 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>2</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M215.5,-172C215.5,-172 113.5,-172 113.5,-172 107.5,-172 101.5,-166 101.5,-160 101.5,-160 101.5,-116 101.5,-116 101.5,-110 107.5,-104 113.5,-104 113.5,-104 215.5,-104 215.5,-104 221.5,-104 227.5,-110 227.5,-116 227.5,-116 227.5,-160 227.5,-160 227.5,-166 221.5,-172 215.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b1 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 92</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.108</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;2 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>1&#45;&gt;2</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M301.493,-208.867C280.855,-198.341 257.769,-186.567 236.517,-175.729\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"238.032,-172.572 227.534,-171.147 234.852,-178.808 238.032,-172.572\"/>\r\n",
       "</g>\r\n",
       "<!-- 5 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>5</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M415.5,-172C415.5,-172 313.5,-172 313.5,-172 307.5,-172 301.5,-166 301.5,-160 301.5,-160 301.5,-116 301.5,-116 301.5,-110 307.5,-104 313.5,-104 313.5,-104 415.5,-104 415.5,-104 421.5,-104 427.5,-110 427.5,-116 427.5,-116 427.5,-160 427.5,-160 427.5,-166 421.5,-172 415.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 54</text>\r\n",
       "<text text-anchor=\"middle\" x=\"364.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 1.106</text>\r\n",
       "</g>\r\n",
       "<!-- 1&#45;&gt;5 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;5</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M364.5,-207.884C364.5,-199.778 364.5,-190.982 364.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"368,-182.299 364.5,-172.299 361,-182.299 368,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 3 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>3</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M87,-68C87,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,-0 12,-0 12,-0 87,-0 87,-0 93,-0 99,-6 99,-12 99,-12 99,-56 99,-56 99,-62 93,-68 87,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">3</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=80</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 32/48</text>\r\n",
       "<text text-anchor=\"middle\" x=\"49.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.019</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;3 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>2&#45;&gt;3</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127.163,-103.884C116.819,-94.7089 105.478,-84.6503 94.7364,-75.1227\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"96.8471,-72.3165 87.0434,-68.2994 92.2022,-77.5534 96.8471,-72.3165\"/>\r\n",
       "</g>\r\n",
       "<!-- 4 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>4</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M200,-68C200,-68 129,-68 129,-68 123,-68 117,-62 117,-56 117,-56 117,-12 117,-12 117,-6 123,-0 129,-0 129,-0 200,-0 200,-0 206,-0 212,-6 212,-12 212,-12 212,-56 212,-56 212,-62 206,-68 200,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 7/5</text>\r\n",
       "<text text-anchor=\"middle\" x=\"164.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.575</text>\r\n",
       "</g>\r\n",
       "<!-- 2&#45;&gt;4 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;4</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M164.5,-103.884C164.5,-95.7778 164.5,-86.982 164.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"168,-78.2993 164.5,-68.2994 161,-78.2994 168,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 6 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>6</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M313,-68C313,-68 242,-68 242,-68 236,-68 230,-62 230,-56 230,-56 230,-12 230,-12 230,-6 236,-0 242,-0 242,-0 313,-0 313,-0 319,-0 325,-6 325,-12 325,-12 325,-56 325,-56 325,-62 319,-68 313,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">6</text>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=50</text>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 36/14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"277.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.573</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;6 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>5&#45;&gt;6</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M336.254,-103.884C328.656,-94.9762 320.348,-85.2354 312.434,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"315.055,-73.6364 305.902,-68.2994 309.729,-78.1791 315.055,-73.6364\"/>\r\n",
       "</g>\r\n",
       "<!-- 7 -->\r\n",
       "<g id=\"node8\" class=\"node\"><title>7</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M430,-68C430,-68 355,-68 355,-68 349,-68 343,-62 343,-56 343,-56 343,-12 343,-12 343,-6 349,-0 355,-0 355,-0 430,-0 430,-0 436,-0 442,-6 442,-12 442,-12 442,-56 442,-56 442,-62 436,-68 430,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">7</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=4</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 2/2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"392.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.323</text>\r\n",
       "</g>\r\n",
       "<!-- 5&#45;&gt;7 -->\r\n",
       "<g id=\"edge7\" class=\"edge\"><title>5&#45;&gt;7</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M373.591,-103.884C375.84,-95.6887 378.284,-86.7886 380.643,-78.1917\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"384.087,-78.8692 383.359,-68.2994 377.337,-77.0161 384.087,-78.8692\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node10\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#ffaaaa\" stroke=\"black\" d=\"M586.5,-172C586.5,-172 484.5,-172 484.5,-172 478.5,-172 472.5,-166 472.5,-160 472.5,-160 472.5,-116 472.5,-116 472.5,-110 478.5,-104 484.5,-104 484.5,-104 586.5,-104 586.5,-104 592.5,-104 598.5,-110 598.5,-116 598.5,-116 598.5,-160 598.5,-160 598.5,-166 592.5,-172 586.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b4 &lt;= 2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 42</text>\r\n",
       "<text text-anchor=\"middle\" x=\"535.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 3.623</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge9\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M535.5,-207.884C535.5,-199.778 535.5,-190.982 535.5,-182.472\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"539,-182.299 535.5,-172.299 532,-182.299 539,-182.299\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node13\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M793.5,-172C793.5,-172 691.5,-172 691.5,-172 685.5,-172 679.5,-166 679.5,-160 679.5,-160 679.5,-116 679.5,-116 679.5,-110 685.5,-104 691.5,-104 691.5,-104 793.5,-104 793.5,-104 799.5,-104 805.5,-110 805.5,-116 805.5,-116 805.5,-160 805.5,-160 805.5,-166 799.5,-172 793.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 480</text>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.139</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge12\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M598.732,-209.842C621.299,-198.722 646.892,-186.111 670.166,-174.643\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"671.876,-177.702 679.299,-170.142 668.782,-171.423 671.876,-177.702\"/>\r\n",
       "</g>\r\n",
       "<!-- 10 -->\r\n",
       "<g id=\"node11\" class=\"node\"><title>10</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M543,-68C543,-68 472,-68 472,-68 466,-68 460,-62 460,-56 460,-56 460,-12 460,-12 460,-6 466,-0 472,-0 472,-0 543,-0 543,-0 549,-0 555,-6 555,-12 555,-12 555,-56 555,-56 555,-62 549,-68 543,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"507.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">10</text>\r\n",
       "<text text-anchor=\"middle\" x=\"507.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=2</text>\r\n",
       "<text text-anchor=\"middle\" x=\"507.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 2/0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"507.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.682</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;10 -->\r\n",
       "<g id=\"edge10\" class=\"edge\"><title>9&#45;&gt;10</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M526.409,-103.884C524.16,-95.6887 521.716,-86.7886 519.357,-78.1917\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"522.663,-77.0161 516.641,-68.2994 515.913,-78.8692 522.663,-77.0161\"/>\r\n",
       "</g>\r\n",
       "<!-- 11 -->\r\n",
       "<g id=\"node12\" class=\"node\"><title>11</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M660,-68C660,-68 585,-68 585,-68 579,-68 573,-62 573,-56 573,-56 573,-12 573,-12 573,-6 579,-0 585,-0 585,-0 660,-0 660,-0 666,-0 672,-6 672,-12 672,-12 672,-56 672,-56 672,-62 666,-68 660,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=40</text>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 6/34</text>\r\n",
       "<text text-anchor=\"middle\" x=\"622.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.195</text>\r\n",
       "</g>\r\n",
       "<!-- 9&#45;&gt;11 -->\r\n",
       "<g id=\"edge11\" class=\"edge\"><title>9&#45;&gt;11</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M563.746,-103.884C571.344,-94.9762 579.652,-85.2354 587.566,-75.9566\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"590.271,-78.1791 594.098,-68.2994 584.945,-73.6364 590.271,-78.1791\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node14\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M782.5,-68C782.5,-68 702.5,-68 702.5,-68 696.5,-68 690.5,-62 690.5,-56 690.5,-56 690.5,-12 690.5,-12 690.5,-6 696.5,-0 702.5,-0 702.5,-0 782.5,-0 782.5,-0 788.5,-0 794.5,-6 794.5,-12 794.5,-12 794.5,-56 794.5,-56 794.5,-62 788.5,-68 782.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=334</text>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 85/249</text>\r\n",
       "<text text-anchor=\"middle\" x=\"742.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.334</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge13\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M742.5,-103.884C742.5,-95.7778 742.5,-86.982 742.5,-78.4721\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"746,-78.2993 742.5,-68.2994 739,-78.2994 746,-78.2993\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node15\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M904.5,-68C904.5,-68 824.5,-68 824.5,-68 818.5,-68 812.5,-62 812.5,-56 812.5,-56 812.5,-12 812.5,-12 812.5,-6 818.5,-0 824.5,-0 824.5,-0 904.5,-0 904.5,-0 910.5,-0 916.5,-6 916.5,-12 916.5,-12 916.5,-56 916.5,-56 916.5,-62 910.5,-68 904.5,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"864.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"864.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=146</text>\r\n",
       "<text text-anchor=\"middle\" x=\"864.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 84/62</text>\r\n",
       "<text text-anchor=\"middle\" x=\"864.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.244</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge14\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M782.11,-103.884C793.19,-94.6199 805.348,-84.4549 816.842,-74.8454\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"819.244,-77.3988 824.671,-68.2994 814.754,-72.0284 819.244,-77.3988\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2605613eca0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n",
       "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\r\n",
       " -->\r\n",
       "<!-- Title: Tree Pages: 1 -->\r\n",
       "<svg width=\"371pt\" height=\"388pt\"\r\n",
       " viewBox=\"0.00 0.00 371.00 388.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 384)\">\r\n",
       "<title>Tree</title>\r\n",
       "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-384 367,-384 367,4 -4,4\"/>\r\n",
       "<!-- 0 -->\r\n",
       "<g id=\"node1\" class=\"node\"><title>0</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M169,-380C169,-380 67,-380 67,-380 61,-380 55,-374 55,-368 55,-368 55,-324 55,-324 55,-318 61,-312 67,-312 67,-312 169,-312 169,-312 175,-312 181,-318 181,-324 181,-324 181,-368 181,-368 181,-374 175,-380 169,-380\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">0</text>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b0 &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-334.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 668</text>\r\n",
       "<text text-anchor=\"middle\" x=\"118\" y=\"-319.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 6.095</text>\r\n",
       "</g>\r\n",
       "<!-- 1 -->\r\n",
       "<g id=\"node2\" class=\"node\"><title>1</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M92,-276C92,-276 12,-276 12,-276 6,-276 0,-270 0,-264 0,-264 0,-220 0,-220 0,-214 6,-208 12,-208 12,-208 92,-208 92,-208 98,-208 104,-214 104,-220 104,-220 104,-264 104,-264 104,-270 98,-276 92,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=146</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 77/69</text>\r\n",
       "<text text-anchor=\"middle\" x=\"52\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.242</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;1 -->\r\n",
       "<g id=\"edge1\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M96.5717,-311.884C90.981,-303.243 84.883,-293.819 79.0424,-284.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"81.9177,-282.794 73.5466,-276.299 76.0407,-286.596 81.9177,-282.794\"/>\r\n",
       "</g>\r\n",
       "<!-- 8 -->\r\n",
       "<g id=\"node3\" class=\"node\"><title>8</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M236,-276C236,-276 134,-276 134,-276 128,-276 122,-270 122,-264 122,-264 122,-220 122,-220 122,-214 128,-208 134,-208 134,-208 236,-208 236,-208 242,-208 248,-214 248,-220 248,-220 248,-264 248,-264 248,-270 242,-276 236,-276\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">8</text>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">b0 &lt;= 11</text>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 522</text>\r\n",
       "<text text-anchor=\"middle\" x=\"185\" y=\"-215.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.371</text>\r\n",
       "</g>\r\n",
       "<!-- 0&#45;&gt;8 -->\r\n",
       "<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;8</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M139.753,-311.884C145.428,-303.243 151.619,-293.819 157.548,-284.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"160.562,-286.579 163.127,-276.299 154.711,-282.736 160.562,-286.579\"/>\r\n",
       "</g>\r\n",
       "<!-- 9 -->\r\n",
       "<g id=\"node4\" class=\"node\"><title>9</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M156.5,-172C156.5,-172 81.5,-172 81.5,-172 75.5,-172 69.5,-166 69.5,-160 69.5,-160 69.5,-116 69.5,-116 69.5,-110 75.5,-104 81.5,-104 81.5,-104 156.5,-104 156.5,-104 162.5,-104 168.5,-110 168.5,-116 168.5,-116 168.5,-160 168.5,-160 168.5,-166 162.5,-172 156.5,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"119\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">9</text>\r\n",
       "<text text-anchor=\"middle\" x=\"119\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=42</text>\r\n",
       "<text text-anchor=\"middle\" x=\"119\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 8/34</text>\r\n",
       "<text text-anchor=\"middle\" x=\"119\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;1.051</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;9 -->\r\n",
       "<g id=\"edge3\" class=\"edge\"><title>8&#45;&gt;9</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M163.572,-207.884C157.981,-199.243 151.883,-189.819 146.042,-180.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"148.918,-178.794 140.547,-172.299 143.041,-182.596 148.918,-178.794\"/>\r\n",
       "</g>\r\n",
       "<!-- 12 -->\r\n",
       "<g id=\"node5\" class=\"node\"><title>12</title>\r\n",
       "<path fill=\"#ffffff\" stroke=\"black\" d=\"M301,-172C301,-172 199,-172 199,-172 193,-172 187,-166 187,-160 187,-160 187,-116 187,-116 187,-110 193,-104 199,-104 199,-104 301,-104 301,-104 307,-104 313,-110 313,-116 313,-116 313,-160 313,-160 313,-166 307,-172 301,-172\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"250\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">12</text>\r\n",
       "<text text-anchor=\"middle\" x=\"250\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">fare &lt;= 1</text>\r\n",
       "<text text-anchor=\"middle\" x=\"250\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 480</text>\r\n",
       "<text text-anchor=\"middle\" x=\"250\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">sim_gain = 8.139</text>\r\n",
       "</g>\r\n",
       "<!-- 8&#45;&gt;12 -->\r\n",
       "<g id=\"edge4\" class=\"edge\"><title>8&#45;&gt;12</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M206.104,-207.884C211.61,-199.243 217.615,-189.819 223.367,-180.793\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"226.357,-182.614 228.78,-172.299 220.454,-178.852 226.357,-182.614\"/>\r\n",
       "</g>\r\n",
       "<!-- 13 -->\r\n",
       "<g id=\"node6\" class=\"node\"><title>13</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M229,-68C229,-68 149,-68 149,-68 143,-68 137,-62 137,-56 137,-56 137,-12 137,-12 137,-6 143,-0 149,-0 149,-0 229,-0 229,-0 235,-0 241,-6 241,-12 241,-12 241,-56 241,-56 241,-62 235,-68 229,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"189\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">13</text>\r\n",
       "<text text-anchor=\"middle\" x=\"189\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=334</text>\r\n",
       "<text text-anchor=\"middle\" x=\"189\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 85/249</text>\r\n",
       "<text text-anchor=\"middle\" x=\"189\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=&#45;0.334</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;13 -->\r\n",
       "<g id=\"edge5\" class=\"edge\"><title>12&#45;&gt;13</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M230.195,-103.884C225.081,-95.3324 219.508,-86.0134 214.161,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"217.051,-75.0853 208.914,-68.2994 211.043,-78.6781 217.051,-75.0853\"/>\r\n",
       "</g>\r\n",
       "<!-- 14 -->\r\n",
       "<g id=\"node7\" class=\"node\"><title>14</title>\r\n",
       "<path fill=\"#22ee22\" stroke=\"black\" d=\"M351,-68C351,-68 271,-68 271,-68 265,-68 259,-62 259,-56 259,-56 259,-12 259,-12 259,-6 265,-0 271,-0 271,-0 351,-0 351,-0 357,-0 363,-6 363,-12 363,-12 363,-56 363,-56 363,-62 357,-68 351,-68\"/>\r\n",
       "<text text-anchor=\"middle\" x=\"311\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">14</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples=146</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">+/&#45; = 84/62</text>\r\n",
       "<text text-anchor=\"middle\" x=\"311\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value=0.244</text>\r\n",
       "</g>\r\n",
       "<!-- 12&#45;&gt;14 -->\r\n",
       "<g id=\"edge6\" class=\"edge\"><title>12&#45;&gt;14</title>\r\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M269.805,-103.884C274.919,-95.3324 280.492,-86.0134 285.839,-77.0722\"/>\r\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"288.957,-78.6781 291.086,-68.2994 282.949,-75.0853 288.957,-78.6781\"/>\r\n",
       "</g>\r\n",
       "</g>\r\n",
       "</svg>\r\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x2605613e460>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>y</th>\n",
       "      <th>y</th>\n",
       "      <th>$p_4$</th>\n",
       "      <th>$l_4$</th>\n",
       "      <th>$r_4$</th>\n",
       "      <th>$\\gamma_4$</th>\n",
       "      <th>$l_5$</th>\n",
       "      <th>$p_5$</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>-0.318581</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.454243</td>\n",
       "      <td>-0.183540</td>\n",
       "      <td>0.545757</td>\n",
       "      <td>0.243784</td>\n",
       "      <td>-0.110404</td>\n",
       "      <td>0.472427</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.653711</td>\n",
       "      <td>0.635390</td>\n",
       "      <td>0.346289</td>\n",
       "      <td>0.243784</td>\n",
       "      <td>0.708525</td>\n",
       "      <td>0.670075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>-0.318581</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>-0.318581</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>-0.318581</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.488494</td>\n",
       "      <td>-0.046031</td>\n",
       "      <td>-0.488494</td>\n",
       "      <td>0.241519</td>\n",
       "      <td>0.026425</td>\n",
       "      <td>0.506606</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>-0.318581</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>-0.318581</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.318581</td>\n",
       "      <td>-0.760303</td>\n",
       "      <td>0.681419</td>\n",
       "      <td>-0.333904</td>\n",
       "      <td>-0.860474</td>\n",
       "      <td>0.297240</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>668 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     y  y     $p_4$     $l_4$     $r_4$  $\\gamma_4$     $l_5$     $p_5$\n",
       "0    0  0  0.318581 -0.760303 -0.318581   -0.333904 -0.860474  0.297240\n",
       "1    1  1  0.454243 -0.183540  0.545757    0.243784 -0.110404  0.472427\n",
       "2    1  1  0.653711  0.635390  0.346289    0.243784  0.708525  0.670075\n",
       "3    0  0  0.318581 -0.760303 -0.318581   -0.333904 -0.860474  0.297240\n",
       "4    0  0  0.318581 -0.760303 -0.318581   -0.333904 -0.860474  0.297240\n",
       "..  .. ..       ...       ...       ...         ...       ...       ...\n",
       "663  0  0  0.318581 -0.760303 -0.318581   -0.333904 -0.860474  0.297240\n",
       "664  0  0  0.488494 -0.046031 -0.488494    0.241519  0.026425  0.506606\n",
       "665  0  0  0.318581 -0.760303 -0.318581   -0.333904 -0.860474  0.297240\n",
       "666  0  0  0.318581 -0.760303 -0.318581   -0.333904 -0.860474  0.297240\n",
       "667  1  1  0.318581 -0.760303  0.681419   -0.333904 -0.860474  0.297240\n",
       "\n",
       "[668 rows x 8 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "iterate(4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's stop at Iteration 4. And take a look at the loss."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd5xU9d328c93G70X6U1ApZelSBFUVJQodhHFQjFEMVhy5zY9953cecxjMGLUKFUREI1iLFFQVIoICwsiUqQtHWEp0ha3f58/ZrifzTrAAjt7tlzv12tf7Mz5zZlrf657zTln5hxzd0RERPKLCTqAiIgUTyoIERGJSAUhIiIRqSBERCQiFYSIiESkghARkYhUEFLqmdk2MxsQdA4AM/ujmR0ws71BZxE5ExWESBExs8bA40Abd68XYfn1ZrbXzGrmuW+wme02s2rh225maWZ2PFw0r5lZ9Tzj55tZep7ls82sflH8fFL6qCBEik5T4KC7p0Za6O7vAZ8CfwUI/+H/O/ATdz+SZ2hHd68MtABqAL/Pt6ox4eUtgcrAXwrzh5CyQwUhZYqZlTOzZ8xsT/jrGTMrF15W28zeN7PDZnbIzBaZWUx42X+GX8kfM7MNZnblKdZfzcymmdl+M9tuZr82s5jwLq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SKgLQiR0ztG6DKdJ80ldJK2eAAza21mlSI8rhrwXbgcLiZ0+ceTsk4+HlgI3GhmFcPruQlYVOg/hcg50KsQkdNbDWSHdxW9DIwntHtnZfhA8X7gxgiPmwOMNrPVwAZCu5lOmgCsNrOV7n6Xmb0MLAsvmxTh+INIIPQ2VxERiUi7mEREJCIVhIiIRKSCEBGRiFQQIiISkQpCREQiUkGIiEhEKggREYno/wF6vPbetrhEdgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(loss[1:])\n",
    "plt.title('loss of XBR')\n",
    "plt.xlabel('iteratoin')\n",
    "plt.ylabel('loss')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "class LGBClassifier():\n",
    "    \n",
    "    n_estimators = 100\n",
    "    \n",
    "    #now let's get started\n",
    "    learning_rate=0.3\n",
    "    trees = []\n",
    "    loss = []\n",
    "    residuals = np.zeros([100,n_train])\n",
    "    probabilities = np.zeros([100,n_train])\n",
    "    predictions = np.zeros([100,n_train])\n",
    "    log_of_odds = np.zeros([100,n_train])\n",
    "    gamma = np.zeros([100,n_train])\n",
    "    log_of_odds[0] = [0] * n_train\n",
    "    \n",
    "    \n",
    "    def __init__(self, n_estimators=100):\n",
    "        self.n_estimators = n_estimators\n",
    "        pass\n",
    "    \n",
    "    def iterate(self, i, X_train, y_train):\n",
    "        n_train=len(y_train)\n",
    "        t = LGBTree(max_depth=3, gamma=5)\n",
    "        t.fit(X_train,self.residuals[i], self.probabilities[i])\n",
    "        t.prune()\n",
    "        self.trees.append(t)\n",
    "        \n",
    "\n",
    "        self.gamma[i]=t.predict(X_train)\n",
    "        self.log_of_odds[i+1] = self.log_of_odds[i] + 0.3 * self.gamma[i]\n",
    "        self.probabilities[i+1] = np.array([np.exp(odds)/(np.exp(odds)+1) for odds in self.log_of_odds[i+1]])\n",
    "        self.predictions[i+1] = (self.probabilities[i+1]>0.5)*1.0\n",
    "        self.residuals[i+1]=y_train-self.probabilities[i+1]\n",
    "        _loss=np.sum(-y_train * self.log_of_odds[i+1] + np.log(1+np.exp(self.log_of_odds[i+1])))/n_train\n",
    "        self.loss.append(_loss)\n",
    "\n",
    "    def fit(self, X_train, y_train):\n",
    "        n_train=len(y_train)\n",
    "        #n_estimators=10\n",
    "        #now let's get started\n",
    "        self.learning_rate=0.3\n",
    "        self.loss = []\n",
    "        self.trees = []\n",
    "        self.residuals = np.zeros([self.n_estimators+1, n_train])\n",
    "        self.probabilities = np.zeros([self.n_estimators+1, n_train])\n",
    "        self.predictions = np.zeros([self.n_estimators+1, n_train])\n",
    "        self.log_of_odds = np.zeros([self.n_estimators+1, n_train])\n",
    "        self.gamma = np.zeros([self.n_estimators+1, n_train])\n",
    "        self.log_of_odds[0] = [0] * n_train\n",
    "        self.probabilities[0] = [0.5] * n_train\n",
    "        self.predictions[0] = [1] * n_train\n",
    "        self.residuals[0] = y_train - probabilities[0]\n",
    "        loss0=-(y_train*np.log(probabilities[0])+(1-y_train)*np.log(1-probabilities[0]))\n",
    "        loss0 = np.sum(loss0) / n_train\n",
    "        self.loss.append(loss0)\n",
    "        \n",
    "        for i in range(self.n_estimators):\n",
    "            self.iterate(i, X_train, y_train)\n",
    "\n",
    "    def predict_proba(self, X):\n",
    "        X = np.array(X)\n",
    "        log_of_odds = np.array([0.0] * X.shape[0])\n",
    "        for t in self.trees:\n",
    "            log_of_odds+=t.predict(X)\n",
    "        results = np.array([np.exp(odds)/(np.exp(odds)+1) for odds in log_of_odds])\n",
    "        return results\n",
    "    \n",
    "    def predict(self, X):\n",
    "        proba = self.predict_proba(X)\n",
    "        results = (proba>0.5) * 1.0\n",
    "        return results\n",
    "    \n",
    "    def accuracy(self, X, y):\n",
    "        n=len(y)\n",
    "        y_hat = self.predict(X)\n",
    "        right = np.sum(y_hat == y)\n",
    "        return right/n * 1.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = LGBClassifier(n_estimators=20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "model.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6976047904191617"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.accuracy(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6636771300448431"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.accuracy(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2d2f51966a0>]"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAcQElEQVR4nO3dfXRc9X3n8fdXM3qwZPkJy5b8hG1iybHBBluxgIQszUMxYKBlQ4qdFFqaUJ8TstDunl16cmjTPWe7pyXpSZtCKSEk2YSHJISGhxpDsgk4yYJtGWywEQZj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ag1hfAJPdfQ+k/qECk3L0CXq93ULqf2K5nOkzL4Tb0ruUHuxnN0SQ6+syYJ+7v9XP/KKsr6xsKMp3bCQGveVoyz5GNJ8+BWNmo4GfAXe4+5Gs2S+T2j2xEPg28PMilfVxd18EXAl8xcw+mTU/sHVmZmXAtcBPc8wOan3lK8j19jUgATzUT5czfeZD7V+B84ALgT2kdpNkC/Lf5nJOvzVf8PV1hmzod7EcbQNaZyMx6FuB6RnT04DdZ9GnIMyslNQH+ZC7P549392PuPux9PNVQKmZTSx0Xe6+O/24H/h3Uv8dzBTYOiP1D+tld9+XPSOo9ZW2r2/3Vfpxf44+gaw3M7sZWAZ8wdM7crPl8ZkPKXff5+697p4EvtPP6wW1vuLA9cCP++tT6PXVTzYU5Ts2EoN+PTDHzGaltwRvBJ7M6vMkcFP6SJKLgcN9/z0qpPQ+wO8CLe7+j/30qU33w8yWkPoMDhS4riozq+57Tmowb3NWt0DWWVq/W1pBrK8MTwI3p5/fDDyRo08+38chZWZLgf8BXOvunf30yeczH+q6Msd0/rCf1yv6+kr7DPCGu7fmmlno9XWabCjOd6wQI8yF/iF1hMibpEaiv5ZuWwmsTD834J70/NeAxiLV9QlS/6V6FdiY/rkqq7bbgC2kRs5fAi4tQl2z06+3Kf3aw2mdVZIK7rEZbUVfX6T+0OwBekhtQf0ZcA7wf4G30o8T0n2nAKtO930scF3bSO2z7fuO3ZddV3+feYHr+mH6u/MqqSCqGw7rK93+/b7vVEbfYq6v/rKhKN8xXQJBRCTkRuKuGxERGQAFvYhIyCnoRURCTkEvIhJyCnoRkZBT0IuIhJyCXkQk5P4/bcJrnrCm5ZAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(model.loss)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.6931471805599453,\n",
       " 0.6482120953057027,\n",
       " 0.6250549842348821,\n",
       " 0.6053988223232072,\n",
       " 0.5998176093406533,\n",
       " 0.5916701824220582,\n",
       " 0.5911402487405213,\n",
       " 0.5908771438768804,\n",
       " 0.5907467618082235,\n",
       " 0.5906822457571622,\n",
       " 0.5906503570852505,\n",
       " 0.5906346081617332,\n",
       " 0.5906268348071715,\n",
       " 0.5906229996628869,\n",
       " 0.5906211080882412,\n",
       " 0.5906201753238097,\n",
       " 0.5906197154332583,\n",
       " 0.5906194887129463,\n",
       " 0.5906193769511016,\n",
       " 0.5906193218609966,\n",
       " 0.5906192947067729]"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.loss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
